mirror of
https://github.com/ditkrg/rswag.git
synced 2026-01-25 07:16:40 +00:00
add formData support
This commit is contained in:
@@ -14,15 +14,23 @@
|
||||
"description": "Creates a new blog from provided data",
|
||||
"operationId": "createBlog",
|
||||
"consumes": [
|
||||
"application/json"
|
||||
"application/x-www-form-urlencoded"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "blog",
|
||||
"in": "body",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/blog"
|
||||
}
|
||||
"name": "blog[title]",
|
||||
"in": "formData",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "blog[content]",
|
||||
"in": "formData",
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"name": "blog[thumbnail]",
|
||||
"in": "formData",
|
||||
"type": "file"
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
@@ -107,7 +115,8 @@
|
||||
"application/json": {
|
||||
"id": 1,
|
||||
"title": "Hello world!",
|
||||
"content": "Hello world and hello universe. Thank you all very much!!!"
|
||||
"content": "Hello world and hello universe. Thank you all very much!!!",
|
||||
"thumbnail": "thumbnail.png"
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -116,6 +125,43 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/blogs/{id}/upload": {
|
||||
"parameters": [
|
||||
{
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"type": "string",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"put": {
|
||||
"summary": "upload a blog thumbnail",
|
||||
"tags": [
|
||||
"Blogs"
|
||||
],
|
||||
"description": "Upload a thumbnail for specific blog by id",
|
||||
"operationId": "uploadThumbnailBlog",
|
||||
"consumes": [
|
||||
"application/x-www-form-urlencoded"
|
||||
],
|
||||
"parameters": [
|
||||
{
|
||||
"name": "file",
|
||||
"in": "formData",
|
||||
"type": "file",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "blog updated"
|
||||
},
|
||||
"404": {
|
||||
"description": "blog not found"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"definitions": {
|
||||
@@ -147,12 +193,16 @@
|
||||
},
|
||||
"content": {
|
||||
"type": "string"
|
||||
},
|
||||
"thumbnail": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"id",
|
||||
"title",
|
||||
"content"
|
||||
"content",
|
||||
"thumbnail"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user