Skip to content

Syntax error when enum in a Schema Object is a list of objects #876

Closed
@denniskloyn

Description

@denniskloyn

If a Schema Object enum contains a list of objects (instead of—more commonly—a list strings) an error is thrown: SyntaxError: '=>' expected. This error message looks similar to the one in bug #561.

Note that an enum in a schema object may contain a list of anything. As per https://swagger.io/specification/#schema-object enum “[is] taken directly from the JSON Schema definition and follow[s] the same specifications”. The JSON Schema definition, https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.20, says that “Elements in the array MAY be of any type, including null.”

Metadata

Metadata

Assignees

No one assigned

    Labels

    PRs welcomePRs are welcome to solve this issue!bugSomething isn't workingplannedExpected in an upcoming version

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions