mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 15:22:56 +00:00
Add some comments to swagger_rails initializer
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
SwaggerRails.configure do |c|
|
||||
|
||||
# Define the swagger documents you'd like to expose and provide global metadata
|
||||
# Define your swagger documents and provide global metadata
|
||||
# Describe actual operations in your spec/test files
|
||||
c.swagger_doc 'v1/swagger.json' do
|
||||
{
|
||||
info: {
|
||||
|
||||
@@ -1,79 +0,0 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "API V1",
|
||||
"version": "v1"
|
||||
},
|
||||
"paths": {
|
||||
"/blogs": {
|
||||
"post": {
|
||||
"summary": "creates a new blog",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "blog",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"content": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"201": {
|
||||
"description": "valid request"
|
||||
},
|
||||
"422": {
|
||||
"description": "invalid request"
|
||||
}
|
||||
}
|
||||
},
|
||||
"get": {
|
||||
"summary": "searches existing blogs",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"parameters": [
|
||||
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "valid request"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/blogs/{id}": {
|
||||
"get": {
|
||||
"summary": "retreives a specific blog",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"type": "string"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "blog found"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user