Skip to content

Referenced Parameters compiling to Object instead of Array #155

Closed
@bplainia

Description

@bplainia

I am having an issue with parameters being compiled as an object instead of an array. This is invalid OpenAPI.
I am using references heavily.
I have many different yaml files that are referenced by the primary spec so it is easy to maintain.
Each endpoint has parameters, which usually point to another file since they are used everywhere.
When a parameter reference points to something within the same file, the compiled parameter

Example Code (one of the referenced files) that does not work. It compiles to an object that has numbered keys.

'/v1/user':
  get:
    parameters:
      - $ref: 'parameters.yaml#/components/parameters/ApiVersion'
      - $ref: 'parameters.yaml#/components/parameters/Page'

Example Code (one of the referenced files) that does work. It compiles to an array.

'/v1/user':
  get:
    parameters:
      - $ref: 'parameters.yaml#/components/parameters/ApiVersion'
      - $ref: 'parameters.yaml#/components/parameters/Page'
      - $ref: '#/components/parameters/User'

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds investigationWork is needed to figure out the root cause of the problem.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions