Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ocimer opened this issue Dec 1, 2021 · 0 comments
Open

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

ocimer opened this issue Dec 1, 2021 · 0 comments

Comments

@ocimer
Copy link

ocimer commented Dec 1, 2021

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant