[
    {
        "description": "bad syntax (validated against metaschema)",
        "schema": {
            "$ref": "https://spec.openapis.org/oas/3.2/dialect/latest"
        },
        "tests": [
            {
                "description": "descriminator value is not an object",
                "data": {
                    "discriminator": "not an object"
                },
                "valid": false
            },
            {
                "description": "discriminator propertyName is not a string",
                "data": {
                    "discriminator": {
                        "propertyName": [ "not a string" ]
                    }
                },
                "valid": false
            },
            {
                "description": "missing oneOf, anyOf, allOf",
                "data": {
                     "discriminator": {
                         "propertyName": "petType"
                     }
                },
                "valid": true
            },
            {
                "description": "discriminator mapping is not an object",
                "data": {
                    "discriminator": {
                        "propertyName": "petType",
                        "mapping": "not an object"
                    },
                    "allOf": [
                        { "$ref": "#/components/cat" }
                    ]
                },
                "valid": false
            },
            {
                "description": "discriminator mapping value is not a string",
                "data": {
                    "discriminator": {
                        "propertyName": "petType",
                        "mapping": {
                            "cat": [ "not a string" ]
                        }
                    },
                    "allOf": [
                        { "$ref": "#/components/schemas/cat" }
                    ]
                },
                "valid": false
            }
        ]
    },
    {
        "description": "discriminator value is not an object (traverse error)",
        "schema": {
            "$schema": "https://spec.openapis.org/oas/3.2/dialect/latest",
            "discriminator": "not an object"
        },
        "tests": [
            {
                "description": "not an object",
                "data": {},
                "valid": false
            }
        ]
    },
    {
        "description": "missing required property propertyName (traverse error)",
        "schema": {
            "$schema": "https://spec.openapis.org/oas/3.2/dialect/latest",
            "discriminator": {}
        },
        "tests": [
            {
                "description": "missing propertyName",
                "data": {},
                "valid": false
            }
        ]
    },
    {
        "description": "discriminator propertyName is not a string (traverse error)",
        "schema": {
            "$schema": "https://spec.openapis.org/oas/3.2/dialect/latest",
            "discriminator": {
                "propertyName": [ "not a string" ]
            }
        },
        "tests": [
            {
                "description": "propertyName not a string",
                "data": {},
                "valid": false
            }
        ]
    },
    {
        "description": "missing discriminator property (evaluation error)",
        "schema": {
            "$schema": "https://spec.openapis.org/oas/3.2/dialect/latest",
            "discriminator": {
                "propertyName": "petType"
            }
        },
        "tests": [
            {
                "description": "missing discriminator property",
                "data": {},
                "valid": false
            }
        ]
    },
    {
        "description": "discriminator mapping is not an object (traverse error)",
        "schema": {
            "$schema": "https://spec.openapis.org/oas/3.2/dialect/latest",
            "discriminator": {
                "propertyName": "petType",
                "mapping": "not an object"
            },
            "allOf": [
                { "$ref": "#/components/cat" }
            ]
        },
        "tests": [
            {
                "description": "mapping is not an object",
                "data": {},
                "valid": false
            }
        ]
    },
    {
        "description": "discriminator mapping value is not a string (traverse error)",
        "schema": {
            "$schema": "https://spec.openapis.org/oas/3.2/dialect/latest",
            "discriminator": {
                "propertyName": "petType",
                "mapping": {
                    "cat": [ "not a string" ]
                }
            },
            "allOf": [
                { "$ref": "#/components/schemas/cat" }
            ]
        },
        "tests": [
            {
                "description": "mapping property value not a string",
                "data": {},
                "valid": false
            }
        ]
    }
]
