mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 07:16:40 +00:00
Honor basePath, output tags & other cleanup
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user