inakiabtI
Windmillโ€ข3y agoโ€ข
5 replies
inakiabt

Nested JSON schema required fields

Hi, I have the following schema where the goal is to make "name" and "id" required within "Persona" (also set the order of the fields).

For some reason it doesn't work.

Am I missing something or is it an issue?
Thanks.

{
    "properties": {
        "Persona": {
            "type": "object",
            "description": "",
            "properties": {
                "name": {
                    "type": "string",
                    "description": "",
                    "default": ""
                },
                "id": {
                    "type": "number",
                    "description": ""
                },
            },
                        "order": ["name", "id"],
            "required": [
                "name",
                "id"
            ]
        }
    },
    "required": [
        "Persona"
    ],
    "type": "object",
    "order": [
        "Persona"
    ]
}
Was this page helpful?