everwatchsolutions / json-data-generator

A robust, generic, streaming random json data generator for your data
Apache License 2.0
397 stars 176 forks source link

Not able to generate JSON output from the schema #63

Open fazilbe opened 4 years ago

fazilbe commented 4 years ago

Hi,

I am trying to using the framework to generate the json output using the sample schema as below.

{ "$schema": "http://json-schema.org/draft-04/schema", "title": "Basic Info", "type": "object", "properties": { "firstName": { "type": "string" }, "age": { "type": "number" } } }

I am not able to convert or parse the above schema into json output. The code doesn't recognize it as a schema rather it just considers it as another json documents and parses the same. Meaning, it just converts the above schema as such into a json output. I could see from the jsondatagenerator.java classes, that we feed the sample json files like config-array-test.json and convert them. However, the schema i am trying to parse or convert doesn't work. Requesting your inputs on the same.

Below is the output:

{"$schema":"http://json-schema.org/draft-04/schema", "title":"BasicInfo", "type":"object", "properties.firstName.type":"string", "properties.age.type":"number"}

andrewserff commented 4 years ago

I assume your issue is with the properties.firstName.type element? Do you happen to have flatten=true in your config somewhere? What are your producer settings?