Skip to content

Using content to define serialization is not supported in query #104

@ocimer

Description

@ocimer

A complex query parameter that uses content to define serialization is not supported. See "Parameter object" in Swagger docs.

When trying to generate PDF from YAML below it fails. There are no logs that would report the failure, which is disappointing.

openapi: 3.0.0

info:
  version: 0.1.0
  title: "My API. (Test)"
servers:
  - url: "http://example.com/my-api"
    description: "My server"

paths:
  /locations:
    get:
      summary: List of locations
      description: "Return a list of all locations the user has access to."
      operationId: listLocations
      security:
        - tokenJWT: []
      parameters:
        - $ref: "#/components/parameters/FilterParam"
      tags:
        - Locations
      responses:
        "200":
          description: "A list of locations."
        "401":
          description: "Unauthorized."

components:
  parameters:
    FilterParam:
      name: filter
      in: query
      required: false
      description: "Filter as a JSON object."
      content:
        application/json:
          schema:
            type: object
            required:
              - name
            properties:
              id:
                type: integer
              name:
                type: string

Removing content and application/json from FilterParam solves the issue.

components:
  parameters:
    FilterParam:
      name: filter
      in: query
      required: false
      description: "Filter as a JSON object."
      schema:
        type: object
        required:
          - name
        properties:
          id:
            type: integer
          name:
            type: string

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions