add formData support

This commit is contained in:
ali.q
2017-04-15 01:34:05 +04:30
committed by ali
parent 25d8adaf8b
commit 182ee093f4
12 changed files with 154 additions and 18 deletions

View File

@@ -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"
]
}
},