Serve Swagger docs via middleware

This commit is contained in:
domaindrivendev
2016-02-03 23:41:31 -08:00
parent 58691903fb
commit df4b9c80c9
12 changed files with 54 additions and 89 deletions

View File

@@ -1,6 +0,0 @@
SwaggerRails.configure do |c|
# Specify the API version and hence discovery_url (e.g. swagger/v1/swagger.json)
# that will be used to power the embedded swagger-ui
c.target_api_version = 'v1'
end

View File

@@ -1,54 +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 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"
},
"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": {
"ClinicPatientLink": {
"properties": {
"clinic_patient_link": {
"schema": {
"$ref": "#/definitions/ClinicPatientLink"
}
}
}
}
"ClinicPatientLink": {
"properties": {
"name": {
"type": "string"
},
"date_time": {
"type": "string",
"format": "date-time"
}
}
}
}
}