express-openapi-validator icon indicating copy to clipboard operation
express-openapi-validator copied to clipboard

Parameters declared by $ref are skipped

Open tom-inetum-realdolmen opened this issue 2 years ago • 1 comments

Describe the bug Parameters that are declared as a $ref are skipped

To Reproduce file openapi.yaml has this portion:

openapi: 3.0.3
info:
  title: Parameter ReferenceObject
  description: test
  version: '1'
  termsOfService: https://www.google.be
  contact:
    email: [email protected]
security:
  - basicAuth: []
servers:
  - url: http://localhost
    description: local host
paths:
  /subject:
    get:
      summary: Test
      operationId: doTest
      parameters:
        - in: query
          name: firstParam
          schema: 
           type: string
        - $ref: "#/components/parameters/FromDateTime"
        - in: query
          name: secondParam
          schema:
            $ref: "/components/schemas/SecondParam"
      responses:
       ... (abbreviated for clarity)
components:
  schemas:
    SecondParam:
      type: string

  parameters:
    FromDateTime:
      in: query
      name: fromDateTime
      required: false
      schema: 
        type: string

Actual behavior parameter fromDateTime is present in req.openapi.schema.parameters but is not translated/parsed

Expected behavior parameter fromDateTime is fully present in req.openapi.schema.parameters

Examples and context see issue https://github.com/bug-hunters/oas3-tools/issues/59

tom-inetum-realdolmen avatar Jan 12 '23 13:01 tom-inetum-realdolmen

Same. I am having to define them inline for each endpoint. This goes for both path and query parameters. :(

shashanksapre avatar Mar 20 '24 07:03 shashanksapre