Support multiple swagger documents. Add custom_ui_generator. Update readme

This commit is contained in:
domaindrivendev
2016-02-05 14:47:55 -08:00
parent df4b9c80c9
commit 4b40fb9efe
18 changed files with 298 additions and 14 deletions

View File

@@ -1,9 +1,8 @@
SwaggerRails.configure do |c|
# List the names and paths of Swagger
# List the names and paths (relative to config/swagger) of Swagger
# documents you'd like to expose in your swagger-ui
c.swagger_docs = {
'API V1' => '/swagger/v1/swagger.json',
'API V2' => '/swagger/v2/swagger.json'
'API V1' => 'v1/swagger.json'
}
end

View File

@@ -1,4 +1,4 @@
Rails.application.routes.draw do
mount SwaggerRails::Engine => '/api-docs'
mount SwaggerRails::Engine => '/swagger'
end

View File

@@ -3,7 +3,7 @@
"info": {
"version": "0.0.0",
"title": "[Enter a description for your API here]",
"description": "The docs below are powered by the default swagger.json that was installed with swagger_rails. You can update it to describe your API. See here for the complete swagger spec - https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md"
"description": "The docs below are powered by the default swagger.json that gets installed with swagger_rails. You'll need to update it to describe your API. See here for the complete swagger spec - https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md"
},
"paths": {
"/a/sample/resource": {