#529: Fixed body to be part of patch, put, post
This commit is contained in:
@@ -1262,7 +1262,7 @@ const AppCreator = (props) => {
|
||||
}
|
||||
}
|
||||
|
||||
if (item.body !== undefined && item.body.length > 0) {
|
||||
if (item.body !== undefined && item.body !== null && item.body.length > 0) {
|
||||
const required = false
|
||||
newitem = {
|
||||
"in": "body",
|
||||
@@ -1287,21 +1287,38 @@ const AppCreator = (props) => {
|
||||
},
|
||||
}
|
||||
|
||||
/*
|
||||
data.paths[item.url][item.method.toLowerCase()].parameters.push(newitem)
|
||||
} else if (actionBodyRequest.includes(item.method.toUpperCase())) {
|
||||
// Appending an empty field
|
||||
const required = false
|
||||
newitem = {
|
||||
"in": "body",
|
||||
"name": "body",
|
||||
"multiline": true,
|
||||
"description": "Generated by shuffler.io OpenAPI",
|
||||
"required": required,
|
||||
"example": "",
|
||||
"schema": {
|
||||
"type": "string",
|
||||
},
|
||||
}
|
||||
|
||||
// FIXME - add application/json if JSON example?
|
||||
data.paths[item.url][item.method.toLowerCase()]["requestBody"] = {
|
||||
"description": "Generated by Shuffler.io",
|
||||
"required": required,
|
||||
"content": {
|
||||
"example": {
|
||||
"example": item.body,
|
||||
"example": "",
|
||||
},
|
||||
},
|
||||
}
|
||||
*/
|
||||
|
||||
data.paths[item.url][item.method.toLowerCase()].parameters.push(newitem)
|
||||
} else {
|
||||
console.log("Nothing to append?")
|
||||
}
|
||||
|
||||
|
||||
// https://swagger.io/docs/specification/describing-request-body/file-upload/
|
||||
if (item.file_field !== undefined && item.file_field !== null && item.file_field.length > 0) {
|
||||
console.log("HANDLE FILEFIELD SAVE: ", item.file_field)
|
||||
|
||||
Reference in New Issue
Block a user