Skip to content

Array in "type" definition is considered error #148

@franksl

Description

@franksl

Hello,
I have a schema that needs to validate a property that could be an integer or a string like this:

{
    "type": "object",
    "properties": {
        "x": {"type": ["integer", "string"]}
    }
}

As far as I know this is valid in json schema but the library throws an exception "Argument 2 passed to League\OpenAPIValidation\Schema\Keywords\Type::validate() must be of the type string, array given".
Is this valid in openapi spec?
Thanks,
Frank

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions