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?
Summarising the other answers, here are the JSON schema generators proposed so far:
Online:
Python:
NodeJS:
Ruby: