Questions tagged [json-schema-faker]

JSON Schema Faker is a JavaScript tool that combines JSON Schema standard with fake data generators, allowing users to generate fake data that conform to the schema.

JSON schema is a vocabulary that allows you to annotate and validate JSON documents. For example, the schema { "type": "string", "minLength": 5 } validates the JSON data "hello world" because the data is a string and has a minimum length of 5.

JSON schemas can be quite useful for defining how input data should look like. That is where JSON Schema Faker comes into play, because it automates the generation of JSON data that fit to such schemas. The tool can be quite useful when dealing with API testing.

Links:

8 questions
5
votes
1 answer

How to generate random json data everytime using python?

The following code generates random json data: import json my_dict = {'foo': 42, 'bar': {'baz': "Hello", 'poo': 124.2}} my_json = json.dumps(my_dict) print(my_json) How to automate it so that it generates random json data everytime. Know…
user11218700
3
votes
2 answers

Why does json-schema-faker return Latin for everything?

Using the following schema: and a very simple package.json with the only dependency being json-schema-faker (0.5.0.rc16), when I run the following code I see the output shown at the bottom (an example run) jsf = require('json-schema-faker'); var…
Paul Joireman
  • 2,689
  • 5
  • 25
  • 33
2
votes
1 answer

json schema faker with fake pattern

I'm using the json-schema-faker and i'm using it with Faker which allows me to get random "real" format values, like emails, image url etc. this scheme works well: { "type": "object", "properties": { "myPattern":{ "type": "string", …
Sagiv b.g
  • 30,379
  • 9
  • 68
  • 99
1
vote
2 answers

How to implement JSON Schema Faker with Angular 4 and above

Is it possible to use JSON Schema faker as a third party dependency in Angular. I tried to use the dependency injection to Angular however in the providers I am not able to import jsonSchemaFaker. angular.json "scripts": [ …
Raghavan
  • 61
  • 5
0
votes
0 answers

Webpack fails to build stoplight prism client

I know this is not related to stoplight or webpack directly but something to do with a package called json-schema-faker which fails to build. Here's how to reproduce. A basic js script to initialise the stoplight client and make a request. import {…
dina
  • 937
  • 1
  • 12
  • 29
0
votes
1 answer

combining json-schema-faker schemas into one file

I'm using faker to generate multiple schemas and want to combine the resolved results into one file called ./db.json not multiple files so I can use that file in json-server. I have it currently setup to run and print out multiple files based on the…
me-me
  • 5,139
  • 13
  • 50
  • 91
0
votes
1 answer

json-schema-faker generate new data

I am new to using json-server and json-schema-faker. I can get it to generate records but when I post to the endpoint, the only thing that it posts to the database is an object with id, why doesn't it have the other fields (i.e name, pro1, pro2…
user3214545
  • 2,103
  • 3
  • 20
  • 26
0
votes
0 answers

Faking Json using json-schema-faker

I am trying to fake a hierarchy of JSON schema which goes atleast 4 levels down, when I tried to use json-schema-faker, I am getting the output with only level 1 and for level 2 I am seeing as [object]. Is there a way to get to all the levels and…
lsiva
  • 473
  • 1
  • 7
  • 16