Skip to content

Validate the schema itself #1102

@elrandira

Description

@elrandira

Hi,

in a project of my company, the Draf7Validator is used and I noticed some errors in the schema itself are not detected in our current use. We have a JSON schema definition where the required property was placed inside the properties property instead of outside.

https://json-schema.org/understanding-json-schema/reference/object.html#required

Is there a way to detect such errors?

Or I suppose it would require to run jsonschema on the schema itself but a jsonschema of the jsonschema is needed here.

        "architecture": {
            "type": "object",
            "properties": {
                "variant": {
                    "description": "Customer specific setting.",
                    "type": "string",
                    "enum": [
                        "Default",
                        "TypeA",
                        "TypeB",
                        "TypeC"
                    ],
                    "default": "TypeB"
                },
                "required": [   <== misplaced property
                    "variant"
                ]
            }
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    InvalidNot a bug, PEBKAC, or an unsupported setup

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions