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
Right now grape-swagger-rails expects to be mounted only once, at a single route. It also expects a single global definition of options.url, options.app_url, etc.
It would be really useful if we could mount multiple "swagger roots", just like we can mount multiple APIs at different routes using Grape itself. I think it'll also go a long way towards supporting issues like ruby-grape/grape-swagger#141 and at the very least provide a nice workaround
Would this be something you'd be open to supporting? I'm thinking it'll look something like you can specify a set of options per-mount and you can mount multiple subclasses of GrapeSwaggerRails::Engine at different routes.
P/S: The reason we need this now is due to Swagger 2.0's decision to only support one endpoint/operation for each (unique resource path + HTTP method) combo. The version of swagger-ui vendored here assumes this and only documents the last-mounted endpoint for each path. Since we use accept-header-only versioning, obviously this is very bad for us.
The text was updated successfully, but these errors were encountered:
@suan I had a simmilar issue. In the project, I am using Accept-Version versioning header. I have added the following code to the Rails initializer:
GrapeSwaggerRails.options.before_filter do |request|
if (version = request.query_parameters['version']).present?
GrapeSwaggerRails.options.headers['Accept-Version'] = version
end
end
Then I needed to modify a bit grape-swagger-rails to ensure the headers are taken into consideration upon first SwaggerUi.load() (look at my comment here #25). You can find my forked library here, feel free to use it: https://github.com/GeecoLABs/grape-swagger-rails
Right now grape-swagger-rails expects to be mounted only once, at a single route. It also expects a single global definition of
options.url
,options.app_url
, etc.It would be really useful if we could mount multiple "swagger roots", just like we can mount multiple APIs at different routes using Grape itself. I think it'll also go a long way towards supporting issues like ruby-grape/grape-swagger#141 and at the very least provide a nice workaround
Would this be something you'd be open to supporting? I'm thinking it'll look something like you can specify a set of
options
per-mount and you can mount multiple subclasses ofGrapeSwaggerRails::Engine
at different routes.P/S: The reason we need this now is due to Swagger 2.0's decision to only support one endpoint/operation for each (unique resource path + HTTP method) combo. The version of
swagger-ui
vendored here assumes this and only documents the last-mounted endpoint for each path. Since we use accept-header-only versioning, obviously this is very bad for us.The text was updated successfully, but these errors were encountered: