We have this json schema draft. I would like to get a sample of my JSON data and generate a skeleton for the JSON schema, that I can rework manually, adding things like description, required, etc, which can not be infered from the specific examples.
For example, from my input example.json
:
{
"foo": "lorem",
"bar": "ipsum"
}
I would run my json_schema_generator tool and would get:
{ "foo": {
"type" : "string",
"required" : true,
"description" : "unknown"
},
"bar": {
"type" : "string",
"required" : true,
"description" : "unknown"
}
}
This example has been coded manually, so it has maybe errors. Is there any tool out there which could help me with the conversion JSON -> JSON schema?
There are a lot of tools mentioned, but one more called JSON Schema inferencer for the record:
https://github.com/rnd0101/json_schema_inferencer
(it's not a library or a product, but a Python script)
With the usual Full Disclosure: I am the author.