Honor basePath, output tags & other cleanup

This commit is contained in:
richie
2016-05-13 00:03:23 -07:00
parent 452917e0d9
commit 9a327e84cf
18 changed files with 190 additions and 91 deletions

View File

@@ -1,45 +0,0 @@
{
"swagger": "2.0",
"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 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": {
"post": {
"tags": [
"a/sample/resource"
],
"description": "Create a new sample resource",
"parameters": [
{
"name": "body",
"in": "body",
"schema": {
"$ref": "#/definitions/CreateSampleResource"
}
}
],
"responses": {
"200": {
"description": "Ok"
}
}
}
}
},
"definitions": {
"CreateSampleResource": {
"properties": {
"name": {
"type": "string"
},
"date_time": {
"type": "string",
"format": "date-time"
}
}
}
}
}

View File

@@ -1,13 +1,16 @@
SwaggerRails.configure do |c|
# Define your swagger documents and provide global metadata
# Describe actual operations in your spec/test files
c.swagger_doc 'v1/swagger.json' do
# Define your swagger documents and provide any global metadata here
# (Individual operations are generated from your spec/test files)
c.swagger_doc 'v1/swagger.json',
{
swagger: '2.0',
info: {
title: 'API V1',
version: 'v1'
}
}
end
# Specify a location to output generated swagger files
c.swagger_dir File.expand_path('../../../swagger', __FILE__)
end