Swagger UI overrides accept header parameter - openApi 3.0
See original GitHub issueQ&A (please complete the following information)
- OS: macOS
- Browser: chrome
- Swagger/OpenAPI version: OpenAPI 3.
Content & configuration
Swagger/OpenAPI definition:
paths:
/v1/auth/login:
post:
tags:
- admin
summary: Login
operationId: loginAdmin
description: |
Realiza o login na aplicação
responses:
'200':
description: login success
'422':
description: 'invalid input, object invalid'
parameters:
- name: Content-Type
in: header
required: true
schema:
type: string
example: application/json
default: application/json
- name: Accept
in: header
required: true
schema:
type: string
example: application/json
default: application/json
Problem:
My header when testing always converts accpet to * / * and I need to keep it fixed in application / json
Screenshots
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Describing Parameters - Swagger
In OpenAPI 3.0, parameters are defined in the parameters section of an operation or path. To describe a parameter, you specify its name...
Read more >How to define accept header in Open API Specifiaction V3
In OpenAPI 3, how to document that an Accept header with a specified value is necessary on request in order for a successful...
Read more >Using OpenAPI and Swagger UI - Quarkus
By default, Swagger UI is accessible at /q/swagger-ui . The value / is not allowed as it blocks the application from serving anything...
Read more >F.A.Q - Springdoc-openapi
#For sorting endpoints alphabetically springdoc.swagger-ui. ... Note: Header parameters named Accept, Content-Type and Authorization are not ...
Read more >Swagger UI - openTCS
Responses ; Code, Description, Links ; 200. Successful response · Controls Accept header. Example Value; Schema.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
How can the same be achieved with Get requests without request body?
Same issue here. Made sure to upgrade to the latest version (3.49.0) but it still sets the
accept
header to*/*
instead ofapplication/vnd.api+json
for GET requests with no response body.EDIT: a GET request with no response body might sound weird, but it’s because the corresponding endpoint has no request body nor response body. If I change it for a POST request instead, the issue remains the same because Swagger UI still doesn’t have a request body to determine the
accept
header from.