Thursday, 5 September 2013

Finding inner most keys in JSON

Finding inner most keys in JSON

I am interested in finding the innermost keys of JSON. So for example, if
I have the following JSON :
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Product",
"description": "A product from Acme's catalog",
"type": "object",
"properties": {
"id": {
"description": "The unique identifier for a product",
"type": "integer"
},
"name": {
"description": "Name of the product",
"type": "string"
},
"price": {
"minimum": 0,
"type": "number",
"exclusiveMinimum": true
}
},
"required": ["id", "name", "price"]
}
Then the output should have : description, type, description, type,
minimum, type and exclusiveMinimum as the innermost keys.

No comments:

Post a Comment