JSON Schema:
{
"title": "Amenities",
"additionalProperties": false,
"properties": {
"Footer": {
"type": "string",
"editType": "textarea"
},
"RowType": {
"type": "integer",
"editType": null
},
"answers": {
"type": "array",
"items": {
"type": "object",
"properties": {
"answer": {
"type": "integer",
"editType": null
},
"FooterInner": {
"type": "string",
"editType": "textarea"
}
}
}
}
},
"type": "object"
}
JSON Object:
{
"Footer": "",
"RowType": 0,
"answers": [
{
"answer": 1,
"FooterInner": "innerfooter"
},
{
"answer": 2,
"FooterInner": "innerfooter2"
}
]
}
I need to find properties with "type=integer" in JSON Schema and remove those properties from JSON Object.
Expected JSON Object is:
{
"Footer": "",
"answers": [
{
"FooterInner": "innerfooter"
},
{
"FooterInner": "innerfooter2"
}
]
}
JSON Schema and JSON Objects may differ, so I need to validate and remove "type=integer" properties from any type of JSON Object.
I have searched and could not find something useful, and the main problem is there can be multiple nested elements in JSON.
Might be I need to write recursive iterating function, is there any existing solution?