I want generate json schema from json datafile, like below.(this is generated with online tool, http://jsonschema.net/) is it possible with JSON.NET or any other?
Json DataFile :
{
"graph": [
{
"id": 453,
"cid": 143,
"title": "graph1",
"description": "",
"thumbnailPath": "art.jpg",
"detailPath": "art.jpg",
"link": "www.test.html",
"author": "graph Team"
},
{
"id": 12,
"cid": 121,
"title": "graph2",
"description": "",
"thumbnailPath": "art2.jpg",
"detailPath": "art2.jpg",
"link": "www.test2.html",
"author": "graph Team"
}
]
}
OutPut:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "/",
"type": "object",
"properties": {
"graph": {
"id": "graph",
"type": "array",
"items": {
"id": "1",
"type": "object",
"properties": {
"id": {
"id": "id",
"type": "integer"
},
"cid": {
"id": "cid",
"type": "integer"
},
"title": {
"id": "title",
"type": "string"
},
"description": {
"id": "description",
"type": "string"
},
"thumbnailPath": {
"id": "thumbnailPath",
"type": "string"
},
"detailPath": {
"id": "detailPath",
"type": "string"
},
"link": {
"id": "link",
"type": "string"
},
"author": {
"id": "author",
"type": "string"
}
}
}
}
}
}
my goal is not using a tool because i want generate it on runtime in program.