grape-swagger
grape-swagger copied to clipboard
Default consumes setting for desc method
My POST apis almost do with formData. Now, these methods have consumes setting manually:
desc 'method1', consumes: ['application/x-www-form-urlencoded']
params {}
post {}
desc 'method3', consumes: ['application/x-www-form-urlencoded']
params {}
post {}
...
Is the way to set default consumes to ['application/x-www-form-urlencoded']
?
I have to do the same thing when I try to integrate Swagger-ui into the project.
Failed to find a way to make it global. Here is my walk around for anyone who is interested.
Add this field to your SwaggerUIBundle
parameter
requestInterceptor: function (request) {
request.headers["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8"
return request
}
Hey folks, I've created a PR that adds a global option at #872. Hope it gets reviewed/added soon.