Skip to content

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

@idg10

Description

@idg10

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions