You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using grape-swagger-rails (0.3.0) to generate the documentation for a JSON API. I have an issue with all the actions expecting a payload in JSON format : indeed, the documentation generates a request body with the application/x-www-form-urlencoded format, and my API only handles application/json format.
Therefore, all the "Try it out" actions on the documentation for POST/PUT/PATCH requests are non-functional.
I've tried to manually add a Content-Type header in the GrapeSwaggerRails initialization section, but it doesn't seem to be taken into account :
Am I missing something in the configuration of my endpoints / of grape-swagger-rails here ? I've found nothing around here in the documentation.
EDIT: actually it looks like the payload is correctly understood by my API endpoint on POST and PATCH, but not on PUT requests... in case it helps. Any clues ? When I click "Try it out", I get this in the console for a PUT request only :
The text was updated successfully, but these errors were encountered:
pabuisson
changed the title
Default content-type for generated request
Default content-type for generated PUT request
Apr 3, 2017
@anelson425 well to be honest, we've kind of reduced our usage of grape-swagger so it's not that big a deal for us anymore. And re-reading this issue, I'm thinking that it must be coming from the underlying swagger-ui rather than grape-swagger-rails itself which mostly seems to be a wrapper around swagger. I found several issues in swagger-ui github issues, maybe there's more stuff over there about this problem.
Uh oh!
There was an error while loading. Please reload this page.
Hi guys,
I'm using
grape-swagger-rails (0.3.0)
to generate the documentation for a JSON API. I have an issue with all the actions expecting a payload in JSON format : indeed, the documentation generates a request body with theapplication/x-www-form-urlencoded
format, and my API only handlesapplication/json
format.Therefore, all the "Try it out" actions on the documentation for POST/PUT/PATCH requests are non-functional.
I've tried to manually add a
Content-Type
header in the GrapeSwaggerRails initialization section, but it doesn't seem to be taken into account :Am I missing something in the configuration of my endpoints / of grape-swagger-rails here ? I've found nothing around here in the documentation.
EDIT: actually it looks like the payload is correctly understood by my API endpoint on POST and PATCH, but not on PUT requests... in case it helps. Any clues ? When I click "Try it out", I get this in the console for a PUT request only :
The text was updated successfully, but these errors were encountered: