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

Array entries are not validated against reference-style item types #140

Open
idg10 opened this issue Oct 6, 2020 · 1 comment
Open

Array entries are not validated against reference-style item types #140

idg10 opened this issue Oct 6, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@idg10
Copy link
Contributor

idg10 commented Oct 6, 2020

Given a schema of this form:

- type: array
  items:
    $ref: '#/components/schemas/SomeType'

Menes will validate that items of this schema type are arrays, but it will not validate that the items in the array match the schema referred to.

It does correctly validate array item types if the schema is written out inline inside the items section. This appears to be specific to the use of $ref in this context.

It's possible there is a bug in Microsoft.OpenApi: the basic problem here is that the OpenApiSchema.Items property is not resolving the reference for us. In most cases, is does—there's very little (no?) code in Menes that explicitly resolves $ref references because on the Open API library normally seems to do it for us.

@idg10 idg10 added the bug Something isn't working label Oct 6, 2020
@idg10
Copy link
Contributor Author

idg10 commented Oct 6, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant