Skip to content

Handle Enum as array #30

@kranack

Description

@kranack

I use your library since, well... a few hours and I have to say it's great.
I just have a problem with my schema validation, I described it with a property which can be an array or a integer like this

"inputStates": { "type": ["string", "array"] }

The schema import is doing well but when I'm trying to parse my JSON data, I get this exception

PHP Swaggest\\JsonSchema\\Exception\\EnumException: Enum failed, enum: ["array","boolean","integer","null","number","object","string"], data: ["string","array"] at #->properties:definitions->additionalProperties:command->properties:properties->additionalProperties:inputStates->properties:type->anyOf[0]

I don't know if this is a real issue or just me misunderstanding the library but it should be great if the processEnum function handles the array.

Tell me what you think about it :)

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