mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-24 14:56:41 +00:00
96 lines
2.1 KiB
JSON
96 lines
2.1 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"title": "API V1",
|
|
"version": "v1"
|
|
},
|
|
"paths": {
|
|
"/blogs": {
|
|
"post": {
|
|
"tags": [
|
|
"Blogs API"
|
|
],
|
|
"summary": "creates a new blog",
|
|
"description": "Creates a new blog. You can provide detailed description here which will show up in Implementation Notes.",
|
|
"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": {
|
|
"tags": [
|
|
"Blogs API"
|
|
],
|
|
"summary": "searches existing blogs",
|
|
"description": null,
|
|
"consumes": null,
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "valid request"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/blogs/{id}": {
|
|
"get": {
|
|
"tags": [
|
|
"Blogs API"
|
|
],
|
|
"summary": "retrieves a specific blog",
|
|
"description": "For the id passed in the path, it searches and retrieves a blog against that id. If blog not found it returns a 404",
|
|
"consumes": null,
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"parameters": [
|
|
{
|
|
"name": "id",
|
|
"in": "path",
|
|
"type": "string"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "blog found"
|
|
},
|
|
"404": {
|
|
"description": "blog not found"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |