Skip to content

express-openapi not coercing parameters that use a $ref in their schema #647

@chadxz

Description

@chadxz

When I use a parameter like this:

parameters:
  - name: flag
    in: query
    schema:
      $ref: '#/components/schemas/SomeFlag'

where the component looks like this:

components:
  schemas:
    SomeFlag:
      type: boolean

The parameter that ends up in my controller action hasn't been parsed as the appropriate type. If i inline the schema it works as expected.

Here's a minimal reproduction of my issue: https://github.com/chadxz/param-ref-repro

When i was debugging the issue it looks like there's no support for $ref in openapi-request-coercer, but I don't know if the schema refs should have been resolved prior to getting to that library or not.

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