I would like a JSON Path tool for a schema or/and JSON data file. If you have just a schema, it can help you build the JSON path by giving you the options as you drill down. For example schema below (from
json-schema dot org), you would have initial options of "fruits" or "vegetables", if you have $.vegetables[*]. then veggieName and veggieLike would show up. This would allow you to validate your JSON Paths are correct, even if you don't have data files to match.
Auto generating data files from the schema is nice though, I will have to use that. If you have a schema and a data file then it would provide you the results. This shouldn't be a fairly simple tool to add and would be helpful for my complex JSON models, when I want to build query's or do reference updates.
{
"description": "A representation of a person, company, organization, or place",
"type": "object",
"properties": {
"fruits": {
"type": "array",
"items": {
"type": "string"
}
},
"vegetables": {
"type": "array",
"items": { "$ref": "#/$defs/veggie" }
}
},
"$defs": {
"veggie": {
"type": "object",
"required": [ "veggieName", "veggieLike" ],
"properties": {
"veggieName": {
"type": "string",
"description": "The name of the vegetable."
},
"veggieLike": {
"type": "boolean",
"description": "Do I like this vegetable?"
}
}
}
}
}