mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-24 14:56:41 +00:00
123 lines
3.6 KiB
JSON
123 lines
3.6 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"version": "0.0.0",
|
|
"title": "Dummy app for testing swagger_rails"
|
|
},
|
|
"paths": {
|
|
"/blogs": {
|
|
"post": {
|
|
"description": "Creates a new Blog",
|
|
"parameters": [
|
|
{
|
|
"name": "X-Forwarded-For",
|
|
"in": "header",
|
|
"type": "string",
|
|
"default": "client1"
|
|
},
|
|
{
|
|
"name": "blog",
|
|
"in": "body",
|
|
"schema": {
|
|
"$ref": "#/definitions/Blog"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"201": {
|
|
"description": "Created",
|
|
"schema": {
|
|
"$ref": "#/definitions/Blog"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Invalid Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/RequestError"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"get": {
|
|
"description": "Searches Bloggs",
|
|
"parameters": [
|
|
{
|
|
"name": "published",
|
|
"in": "query",
|
|
"type": "boolean",
|
|
"default": "true"
|
|
},
|
|
{
|
|
"name": "keywords",
|
|
"in": "query",
|
|
"type": "string",
|
|
"default": "Ruby on Rails"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Ok",
|
|
"schema": {
|
|
"type": "array",
|
|
"item": {
|
|
"$ref": "#/definitions/Blog"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
},
|
|
"/blogs/{id}": {
|
|
"get": {
|
|
"description": "Retrieves a specific Blog by unique ID",
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"type": "string",
|
|
"default": "123"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "Ok",
|
|
"schema": {
|
|
"$ref": "#/definitions/Blog"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"Blog": {
|
|
"properties": {
|
|
"title": {
|
|
"type": "string"
|
|
},
|
|
"content": {
|
|
"type": "string",
|
|
"format": "date-time"
|
|
}
|
|
},
|
|
"example": {
|
|
"title": "Test Blog",
|
|
"content": "Hello World"
|
|
}
|
|
},
|
|
"RequestError": {
|
|
"type": "object",
|
|
"additionalProperties": {
|
|
"type": "array",
|
|
"item": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"example": {
|
|
"title": [ "is required" ]
|
|
}
|
|
}
|
|
}
|
|
}
|