fake-schema-cli
Advanced tools
+1
-0
@@ -7,2 +7,3 @@ sudo: required | ||
| - 9 | ||
| - 12 | ||
| before_script: | ||
@@ -9,0 +10,0 @@ - npm run lint |
+2
-2
@@ -29,3 +29,3 @@ | ||
| } | ||
| const root = Object.assign({}, schema.definitions[rootSchema]); | ||
| const root = { ...schema.definitions[rootSchema] }; | ||
| root.definitions = schema.definitions; | ||
@@ -35,3 +35,3 @@ schema = root; | ||
| return schema; | ||
| }).then(schema => jsf.resolve(schema)); | ||
| }).then((schema) => jsf.resolve(schema)); | ||
| }; | ||
@@ -38,0 +38,0 @@ }, |
@@ -45,3 +45,3 @@ /* eslint-env mocha */ | ||
| const generate = generator | ||
| .configure({}, 'en', filename => generator.readFile(filename)); | ||
| .configure({}, 'en', (filename) => generator.readFile(filename)); | ||
@@ -53,3 +53,3 @@ return expect(generate(path.resolve(__dirname, '../fixtures/Definitions.yaml'), undefined, true)) | ||
| it('should read a YAML and generate overriding root-schema', () => { | ||
| const generate = generator.configure({}, 'en', filename => generator.readFile(filename)); | ||
| const generate = generator.configure({}, 'en', (filename) => generator.readFile(filename)); | ||
@@ -61,3 +61,3 @@ return expect(generate(path.resolve(__dirname, '../fixtures/Definitions.yaml'), 'poulet', true)) | ||
| it('should read a YAML and generate overriding root-schema with inner references', () => { | ||
| const generate = generator.configure({}, 'en', filename => generator.readFile(filename)); | ||
| const generate = generator.configure({}, 'en', (filename) => generator.readFile(filename)); | ||
@@ -69,3 +69,3 @@ return expect(generate(path.resolve(__dirname, '../fixtures/DefinitionsInner.yaml'), 'ABC', true)) | ||
| it('should generate overriding max items', () => { | ||
| const generate = generator.configure({ maxItems: 1 }, 'en', filename => generator.readFile(filename)); | ||
| const generate = generator.configure({ maxItems: 1 }, 'en', (filename) => generator.readFile(filename)); | ||
@@ -72,0 +72,0 @@ return expect(generate(path.resolve(__dirname, '../fixtures/N-timesRepeated.json'), undefined, undefined)) |
+1
-1
@@ -7,3 +7,3 @@ #!/usr/bin/env node | ||
| cli | ||
| .version('0.0.4') | ||
| .version('0.1.1') | ||
| .usage('json-schema.yaml -y -l es_MX -r user') | ||
@@ -10,0 +10,0 @@ .option('-r, --rootSchema <value>', 'Set root schema from definitions') |
+4
-4
| { | ||
| "name": "fake-schema-cli", | ||
| "version": "0.1.0", | ||
| "version": "0.1.1", | ||
| "description": "JSON-Schema-Faker CLI", | ||
@@ -31,3 +31,3 @@ "main": "index.js", | ||
| "get-stdin": "^7.0.0", | ||
| "json-schema-faker": "^0.5.0-rc23", | ||
| "json-schema-faker": "^0.5.0-rc24", | ||
| "yamljs": "^0.3.0" | ||
@@ -44,5 +44,5 @@ }, | ||
| "eslint-plugin-react-hooks": "^1.7.0", | ||
| "mocha": "^7.0.0", | ||
| "nyc": "^15.0.0" | ||
| "mocha": "^7.2.0", | ||
| "nyc": "^15.1.0" | ||
| } | ||
| } |
+9
-9
@@ -5,3 +5,3 @@ # fake-schema-cli | ||
| Based on | ||
| Based on | ||
| * https://github.com/oprogramador/json-schema-faker-cli | ||
@@ -43,8 +43,8 @@ * https://github.com/json-schema-faker/website-jsf | ||
| ` http http://json-schema.org/learn/examples/address.schema.json | fake-schema | ||
| ` | ||
| ` http https://json-schema.org/learn/examples/address.schema.json | fake-schema | ||
| ` curl --silent https://json-schema.org/learn/examples/address.schema.json | fake-schema | ||
| * Update result | ||
| * Update result | ||
| `http http://json-schema.org/learn/examples/address.schema.json | node lib/index.js | jq '.locality|="atoms"'` | ||
| `http https://json-schema.org/learn/examples/address.schema.json | node lib/index.js | jq '.locality|="atoms"'` | ||
@@ -54,3 +54,3 @@ | ||
| ```bash | ||
| http http://json-schema.org/learn/examples/address.schema.json | fake-schema | http POST httpbin.org/post | ||
| http https://json-schema.org/learn/examples/address.schema.json | fake-schema | http POST http://bin.org/post | ||
| ``` | ||
@@ -66,5 +66,5 @@ | ||
| ```bash | ||
@@ -74,3 +74,3 @@ #!/usr/bin/env bash | ||
| USER_ID=$(http :8080/swagger.yaml | fake-schema -y -r user | http POST :8080/api/user | jq .id) | ||
| http :8080/swagger.yaml | fake-schema -y -r purchase | jq "'.user.id|=\"$USER_ID\"'" | http post :8080/api/purchase | ||
| http :8080/swagger.yaml | fake-schema -y -r purchase | jq "'.user.id|=\"$USER_ID\"'" | http post :8080/api/purchase | ||
@@ -77,0 +77,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
12778
2.04%0
-100%