-
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
How can multiple response content types and parameter content type be set? #119
Comments
Im also interested |
So, I checked and you would need to add something like "supportedContentTypes : ['application/json', 'text/yaml']" in each of the "operations" objects. This will populate the select and set the Accept header when clicking "try out". It is not documented afaik, maybe wasnt in latest stable release. Cheers |
Hi folks, you can use that current field, but for the next release, |
Hi, https://github.com/wordnik/swagger-core/wiki/changelog which suggests not. |
No, it hasn't. The sticking point has been JSON schema (swagger-api/swagger-core#51), which many folks have asked for but seems insufficient for doing what swagger needs to. So until that gets resolved either way, the spec hasn't been released. |
Ok, |
Yes, I know @casualjim is looking at this as well so that'd be helpful for sure. Clarification though, 1.2 spec uses the names "produces" and "consumes". Sorry that wasn't clear |
I have had this working fine for months, with Swagger out of the box. My JSON looks like: { The most annoying thing is that two "Response Content Type" dropdowns appear in swagger-ui, one at the top of the operation (above the parameters) and one embedded within my Message Body parameter area (which is redundant and seems to be completely ignored). For API calls with no Message Body parameter (i.e. a GET as opposed to PUT, POST) the UI works great and I have no complaints. Is there any possibility that the "Response Content Type" dropdown could be suppressed within the Message Body parameter when it exists at the top level of the operation? |
There is a difference between the two. The top level one sets an "Accept" header. The parameter level one sets the "content-type" header. So you could in theory post Json and ask for Xml back. |
Ah, of course. Is there a way to add items to that embedded "content-type" On Tue, Jun 11, 2013 at 12:28 PM, AndrewCsontos [email protected]:
|
This is added to 2.0-develop. Please try it out and post back if you see issues. |
@fehguy produces works, but consumes doesnot when defaultValue is set. |
@akhil - defaultValue of what? |
I used http://demo0536639.mockable.io/api-docs at http://petstore.swagger.wordnik.com/ When I remove the defaultValue entry I see the dropdown |
@akhil - okay, this is an interesting issue, but it's somewhat different than the topic at hand. Can you open a separate issue with the details you gave here? |
done #593 |
At the moment only application/json is available. What is required to add application/xml as option to the selectbox?
The text was updated successfully, but these errors were encountered: