Skip to content

Parameter schema with $ref is not supported #316

@gap777

Description

@gap777

Given api.yaml:

openapi: 3.1.0
paths:
  /ads:
    post:
      summary: Create one or more ads
      operationId: bookAds
      parameters:
        - in: header
          name: X-API-VERSION
          required: true
          schema:
            $ref: '#/components/schemas/SemVer'
components:
  schemas:
    SemVer:
      type: string
      description: Semantic versioning string
      pattern: ^[0-9]+\.[0-9]+\.[0-9]+$

Upgrading from openapi_first from v2.1.1. to 2.2.1 (and openapi_parameters 0.3.4 to 0.4.0)

Calling OpenapiFirst.load(spec) produces this error

OpenapiParameters::NotSupportedError:
       Parameter schema with $ref is not supported: {"in" => "header", "name" => "X-API-VERSION", "required" => true, "schema" => {"$ref" => "#/components/schemas/SemVer"}}

Can you clarify what about this construct is not valid?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions