Skip to content

Commit

Permalink
Replacing "alwaysFakeOptionals" option for "alwaysFakeProbability". (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelmhtr authored and pateketrueke committed Apr 9, 2018
1 parent f83ad48 commit 30949e1
Show file tree
Hide file tree
Showing 19 changed files with 22,841 additions and 16,292 deletions.
4 changes: 2 additions & 2 deletions .github/CONTRIBUTING.md
Expand Up @@ -12,12 +12,12 @@ If you are submitting a bug report, please include the following:

* When submitting *bug reports*, *paste your schema example* whenever possible. This will save us from having to ask you for it later.
* When submitting *Pull Requests (PRs)*, you should request to merge your changes into our `develop` branch.
* Our approach to testing is described in [spec/README.md](spec/README.md).
* Our approach to testing is described in [spec/README.md](/spec/README.md).
* PRs without specs will not be merged anytime soon!

## Releasing new versions

* Create a new entry in the [CHANGELOG.md](CHANGELOG.md) file,
* Create a new entry in the [CHANGELOG](/CHANGELOG) file,
* Re-build and re-release the online demo, see [`website-jsf` gh-pages branch](https://github.com/json-schema-faker/website-jsf/tree/gh-pages).

## Development tasks
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG
@@ -1,3 +1,7 @@
v0.5.0-rc15
date: 2018-04-07
changes:
- Introduced option: "optionalsProbability".
v0.5.0-rc1
date: 2017-04-10
changes:
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -446,6 +446,7 @@ You may define following options for `jsf` that alter its behavior:
- `maxLength`: number - Configure a maximum length to allow generating strings for. This will override the maximum length found inside a JSON Schema.
- `random`: Function - a replacement for `Math.random` to support pseudorandom number generation.
- `alwaysFakeOptionals`: boolean - When true, all object-properties will be generated regardless they're `required` or not.
- `optionalsProbability`: number - A decimal number from 0 to 1 that indicates the probability to fake a non-required object property (default: 0). When `0.0`, only `required` properties will be generated; when `1.0`, all properties are generated. This option is overwritten to 1 when `alwaysFakeOptionals = true`.

Set options just as below:

Expand Down
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "json-schema-faker",
"version": "0.5.0-rc14",
"version": "0.5.0-rc15",
"description": "JSON-Schema + fake data generators",
"homepage": "http://json-schema-faker.js.org",
"main": "dist/json-schema-faker.js",
Expand Down
37,716 changes: 21,930 additions & 15,786 deletions dist/json-schema-faker.js

Large diffs are not rendered by default.

894 changes: 539 additions & 355 deletions dist/json-schema-faker.min.js

Large diffs are not rendered by default.

0 comments on commit 30949e1

Please sign in to comment.