So I am using a Json Meta Schema https://json-schema.org/draft/2019-09/meta/core to further validate JSONSchema using https://github.com/java-json-tools/json-schema-validator
I have a requirement where I have to restrict a schema from having nested objects , like the below schema should be invalid
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://example.com/product.schema.json",
"title": "test",
"description": "A product from Acme's catalog",
"type": "object",
"properties": {
"productId": {
"description": "Outer",
"type": "object",
"properties": {
"lineId": {
"description": "Outer",
"type": "object"
}
}
}
}
}
Since productId is an object and it has another object lineId , productId can have only string or number fields but never an object ,
How to extend the MetaSchema to enforce this.
Any help is appreciated
draft 2019-09meta-schema, while your schema defines you're usingdraft-07. Which do you plan to use? - Relequestual