Skip to content
Snippets Groups Projects
Commit 61c4646b authored by Jonathan Montane's avatar Jonathan Montane Committed by Alvaro Cabrera Durán
Browse files

Improve object generation compliance with JSON Schema (#159)

* added angular-jsf section in readme

* angular-jsf demo page updated

* chore(package): update fs-extra to version 0.29.0

https://greenkeeper.io/

* chore(package): update fs-extra to version 0.30.0 (#147)

https://greenkeeper.io/

* readme & contribution updated

* tslint introduced, eslint reduced

* minor improvements

* chore(package): update chance to version 1.0.3 (#149)

https://greenkeeper.io/

* Fixed deps

* Fixed #150 so far :D

* 0.3.2

* dependency update

* chore(package): update browserify to version 13.0.1 (#151)

https://greenkeeper.io/

* Allow option to use default values (#156)

* 0.3.3

* Improved object generation compliance with JSON Schema spec

* improved tests for schema objects

* replaced es6 Object.assign by a more traditional for loop

* updated es5 object.assign polyfill to not shadow-var key

* rewrote the object generation again to better support patternProperties

* updated object.ts to match object.js
parent bfd1b54e
No related branches found
No related tags found
No related merge requests found
Showing with 19 additions and 14 deletions
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
"browser": true "browser": true
}, },
"rules": { "rules": {
"quotes": [2, "single", "avoid-escape"],
"semi": [2, "always"], "semi": [2, "always"],
"no-unused-vars": 2, "no-unused-vars": 2,
"no-extra-semi": 2, "no-extra-semi": 2,
......
...@@ -18,13 +18,14 @@ If you're submitting a bug, please clearly state what is: ...@@ -18,13 +18,14 @@ If you're submitting a bug, please clearly state what is:
## Releasing new versions ## Releasing new versions
* Include a new entry in [CHANGELOG.md](CHANGELOG.md) file, * Include a new entry in [CHANGELOG.md](CHANGELOG.md) file,
* Be followed by rebuilding and re-releasing new online demo, see [gh-pages branch](https://github.com/json-schema-faker/json-schema-faker/tree/gh-pages). * Be followed by re-building and re-releasing online demo, see [`website-jsf` gh-pages branch](https://github.com/json-schema-faker/website-jsf/tree/gh-pages).
## Development tasks ## Development tasks
* `npm run dev` — Run the tests and watch (preferred during development) * `npm run dev` — Run the tests and watch (preferred during development)
* `npm run dev:lint` — Run eslint on all sources * `npm run dev:lint` — Run eslint on all sources
* `npm run dev:spec` — Run jasmine-node * `npm run dev:unit` — Run `jasmine-node` on unit tests
* `npm run dev:schema` — Run `jasmine-node` on schema tests
* `npm run cover` — Run istanbul + jasmine-node * `npm run cover` — Run istanbul + jasmine-node
* `npm run cover:up` — Upload to coveralls (CI only) * `npm run cover:up` — Upload to coveralls (CI only)
* `npm run dist` — Prepare all assets with locales for CDN support * `npm run dist` — Prepare all assets with locales for CDN support
......
...@@ -25,6 +25,9 @@ Use [JSON Schema](http://json-schema.org/) along with fake generators to provide ...@@ -25,6 +25,9 @@ Use [JSON Schema](http://json-schema.org/) along with fake generators to provide
- [Overview](#overview) - [Overview](#overview)
- [Example usage](#example-usage) - [Example usage](#example-usage)
- [Gist demos](#gist-demos) - [Gist demos](#gist-demos)
- [Automation](#automation)
- [Angular-jsf (AngularJS plugin)](#angular-jsf)
- [Grunt plugin](#grunt-plugin)
- Advanced - Advanced
- [JSON Schema specification support](#json-schema-specification-support) - [JSON Schema specification support](#json-schema-specification-support)
- [Supported keywords](#supported-keywords) - [Supported keywords](#supported-keywords)
...@@ -36,8 +39,6 @@ Use [JSON Schema](http://json-schema.org/) along with fake generators to provide ...@@ -36,8 +39,6 @@ Use [JSON Schema](http://json-schema.org/) along with fake generators to provide
- [Inferred Types](#inferred-types) - [Inferred Types](#inferred-types)
- [Swagger extensions](#swagger-extensions) - [Swagger extensions](#swagger-extensions)
- [Bundling](#bundling) - [Bundling](#bundling)
- [Automation](#automation)
- [Grunt plugin](#grunt-plugin)
- Misc - Misc
- [Contribution](#contribution) - [Contribution](#contribution)
- [Technical Documentation](#technical-documentation) - [Technical Documentation](#technical-documentation)
...@@ -69,11 +70,11 @@ Install `json-schema-faker` with bower: ...@@ -69,11 +70,11 @@ Install `json-schema-faker` with bower:
JSON-Schema-faker is also available at [cdnjs.com](https://www.cdnjs.com/libraries/json-schema-faker). This means you can just include the script file into your HTML: JSON-Schema-faker is also available at [cdnjs.com](https://www.cdnjs.com/libraries/json-schema-faker). This means you can just include the script file into your HTML:
# remember to update the version number! # remember to update the version number!
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json-schema-faker/0.2.8/json-schema-faker.min.js"></script> <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/json-schema-faker/0.3.1/json-schema-faker.min.js"></script>
It will be fetched from the [Content Delivery Network](https://en.wikipedia.org/wiki/Content_delivery_network) without installing any node.js package. It will be fetched from the [Content Delivery Network](https://en.wikipedia.org/wiki/Content_delivery_network) without installing any node.js package.
You can see [an example JS fiddle based on `jsf` loaded from cdnjs](https://jsfiddle.net/ftzhnmzq/). You can see [an example JS fiddle based on `jsf` loaded from cdnjs](https://jsfiddle.net/ftzhnmzq/4/).
## Overview ## Overview
...@@ -135,6 +136,17 @@ Clone these gists and execute them locally (each gist has its own readme with in ...@@ -135,6 +136,17 @@ Clone these gists and execute them locally (each gist has its own readme with in
* [jsf console](https://gist.github.com/ducin/9f2364ccde2e9248fbcd) - minimal example of jsf working directly under command line * [jsf console](https://gist.github.com/ducin/9f2364ccde2e9248fbcd) - minimal example of jsf working directly under command line
* [jsf grunt](https://gist.github.com/ducin/87e0b55bddd1801d3d99) - example of jsf working under grunt.js * [jsf grunt](https://gist.github.com/ducin/87e0b55bddd1801d3d99) - example of jsf working under grunt.js
## Automation
### angular-jsf
Use [`angular-jsf`](https://github.com/json-schema-faker/angular-jsf) module (installable via `npm` and `bower`) to get **`jsf` working in your angular app out of the box**! And check out [angular-jsf demo](http://angular-jsf.js.org/).
### Grunt plugin
Use [grunt-jsonschema-faker](https://github.com/json-schema-faker/grunt-jsonschema-faker)
to automate running `json-schema-faker` against your JSON schemas.
## JSON Schema specification support ## JSON Schema specification support
Currently `jsf` supports the JSON-Schema specification **draft-04** only. Currently `jsf` supports the JSON-Schema specification **draft-04** only.
...@@ -434,13 +446,6 @@ However, you may want to bundle a smaller package of `jsf`, because: ...@@ -434,13 +446,6 @@ However, you may want to bundle a smaller package of `jsf`, because:
* or for any other reason... * or for any other reason...
In that case you may bundle the distribution yourself manually. It's easily achievable: just modify the [`lib/util/container.js`](lib/util/container.js) file and either remove o rmodify the `require` calls (they're directly used by browserify to include dependencies). Automation of this feature is expected in near future. In that case you may bundle the distribution yourself manually. It's easily achievable: just modify the [`lib/util/container.js`](lib/util/container.js) file and either remove o rmodify the `require` calls (they're directly used by browserify to include dependencies). Automation of this feature is expected in near future.
## Automation
### Grunt plugin
Use [grunt-jsonschema-faker](https://github.com/json-schema-faker/grunt-jsonschema-faker)
to automate running `json-schema-faker` against your JSON schemas.
## Contribution ## Contribution
* [Alvaro Cabrera](https://twitter.com/pateketrueke) * [Alvaro Cabrera](https://twitter.com/pateketrueke)
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment