-
Notifications
You must be signed in to change notification settings - Fork 9k
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
curl "Accept" header issue in relation to the "Response Content Type" selection #2003
Comments
It doesn't appear because your |
Thanks for the tip, I have updated my swagger.json to include schema (see below) and the "Response Content Type" selection is showing up. But the generated curl header still says 'application/json', when I selected 'application/xml': Updated swagger.json:
|
To make it more simple, I think you can delete "produces" in "student" and try it again. A "produces" on the top level is enough. |
This has been tried and the same error is still produced. |
Still experiencing the same problem as described above. Any update on a fix for this? |
any updates on this issue? |
I am having the same problem, with 'Accept: text/html' showing up in the curl command even though I have not specified that anywhere. |
fixed in efb7765 |
@fehguy are you sure this has been fixed. I just downloaded the code from the dist folder (this is from master branch) and the generated curl command is fixed to "text/html" like below:
|
@kchsieh it's been extensively tested, but there's always the possibility of an issue. Can you please share the definition that is producing this? |
@fehguy , thanks for the quick response. My swagger.json spec. is in my March 1st comment above. |
OK I just tested this and get the following:
Can you please make sure you don't have a cached copy of swagger-ui.js in your browser? This issue was originally against ef0fc16276847b22e43a1dc488e246faf20e6e8b but I've updated it to the release 2.1.15 in #2245 |
@kchsieh please pull master / dist and retest? |
@fehguy , just downloaded master/dist again and this time I tested it without put them into my Rails application (suspect it was caching somehow). But when I select 'application/xml' from the 'Response Content Type', the generated curl script still says 'application/json'. Fyi, tested using 3 different browsers and got the same issue. |
OK to be clear, you're now getting a different response than before? |
correct, when I put it into my Rails application, select 'application/xml' or 'application/json', I always got 'text/html'. |
I am using v2.1.4, for some reason the "Response Content Type" does not show up with the spec below and the generated curl command is this (notice the --header 'Accept: text/html' which is strange and nowhere to be found in my spec):
curl -X GET --header 'Accept: text/html' --header 'app_id: my_id_here' --header 'app_key: my_key_here' --header 'sid: 123456' 'http://localhost:3000/student'
The text was updated successfully, but these errors were encountered: