Skip to content

Swagger UI overrides accept header parameter #1448

@lakmali

Description

@lakmali

We are using swagger 2.1.0.

We need to dynamically send different accept header values. For that we added this new parameter accept. But Swagger UI sends application/json as the accept header all the time. We tried setting "produces" with multiple values. But for that swagger UI sends the first value as the accept header.

Is there any workaround for this?

 get:
      x-auth-type: "Application & Application User"
      x-throttling-tier: Unlimited
      produces:
        - "application/xml,application/json"
      parameters:
        - name: id
          allowMultiple: false
          type: string
          required: true
          in: path
        - name: Accept
          type: string
          required: false
          in: header
      responses:
        "200": {}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions