swagger-ui
swagger-ui copied to clipboard
Unnecessary -d '' in CURL when no request body
My OpenApi 3.0 yml opened on HTML page with swagger-ui-dist 5.11.0. In one endpoint where request body absent, Execute run request and produces the following output:
curl -X 'POST' \
'http://localhost:84/query?org=influx&pretty=true&db=influx&q=select%20%2A%20from%20connection' \
-H 'accept: application/json' \
-H 'Authorization: Token my_token' \
-d ''
Execute ends with errors.
The only valid form here without -d
:
curl -X 'POST' \
'http://localhost:84/query?org=influx&pretty=true&db=influx&q=select%20%2A%20from%20connection' \
-H 'accept: application/json' \
-H 'Authorization: Token my_token'
Here in sources I found that swagger-api adds -d ''
for POST requests with no request body.
Seems has no sense.
99.9% servers just ignore such case (empty but present data in CURL when no request body). But I faced with 0.01% where it has sense.
Is it possible to drop -d ''
at all when no request body in POST-request?