mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 15:22:56 +00:00
Basic functionality via minitest
This commit is contained in:
@@ -2,43 +2,117 @@
|
||||
"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"
|
||||
"title": "Dummy app for testing swagger_rails"
|
||||
},
|
||||
"paths": {
|
||||
"/a/sample/resource": {
|
||||
"/blogs": {
|
||||
"post": {
|
||||
"tags": [
|
||||
"a/sample/resource"
|
||||
],
|
||||
"description": "Create a new sample resource",
|
||||
"description": "Creates a new Blog",
|
||||
"parameters": [
|
||||
{
|
||||
"name": "body",
|
||||
"name": "X-Forwarded-For",
|
||||
"in": "header",
|
||||
"type": "string",
|
||||
"default": "client1"
|
||||
},
|
||||
{
|
||||
"name": "blog",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/CreateSampleResource"
|
||||
"$ref": "#/definitions/Blog"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Ok"
|
||||
"description": "Ok",
|
||||
"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": {
|
||||
"$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": {
|
||||
"CreateSampleResource": {
|
||||
"Blog": {
|
||||
"properties": {
|
||||
"name": {
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
"date_time": {
|
||||
"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" ]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user