Skip to content

Invalid "items MUST be present if the type is array" with OpenAPI 3.1 #202

@momala454

Description

@momala454

The error "items MUST be present if the type is array" is returned since openApi 3.1, for nullable arrays, as the type is now an array.

if (! isset($this->parentSchema->type) || ($this->parentSchema->type !== 'array')) {
            throw new InvalidSchema(sprintf('items MUST be present if the type is array'));
        }

The value of $this->parentSchema->type can be an array with :

  • "array"
  • "null"

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