Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
momala454 opened this issue Jun 13, 2023 · 1 comment · May be fixed by #203
Open

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

momala454 opened this issue Jun 13, 2023 · 1 comment · May be fixed by #203

Comments

@momala454
Copy link

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"
@momala454
Copy link
Author

Hello @scaytrase Are you there ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant