Skip to content

Validate the schema itself #1102

Closed
Closed

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"
                ]
            }
        }

Activity

  1. locked and limited conversation to collaborators on Jun 9, 2023
  2. converted this issue into a discussion #1103 on Jun 9, 2023
  3. added
    InvalidNot a bug, PEBKAC, or an unsupported setup
    on Jul 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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