#529: Fixed body to be part of patch, put, post

This commit is contained in:
frikky
2021-10-07 20:50:21 +02:00
parent 0887289149
commit 2da6e43dc6
3 changed files with 25 additions and 7 deletions
+1
View File
@@ -1556,6 +1556,7 @@ const ParsedAction = (props) => {
fullWidth
color="primary"
placeholder={selectedAction.label}
defaultValue={selectedAction.label}
onChange={selectedNameChange}
onBlur={(e) => {
const name = e.target.value
+2 -2
View File
@@ -9248,11 +9248,11 @@ const AngularWorkflow = (props) => {
<div style={{zIndex: 5000, position: "absolute", top: 20, right: 54, height: 50, width: 50,}}>
{selectedApp.reference_info === undefined || selectedApp.reference_info === null || selectedApp.reference_info.github_url === undefined || selectedApp.reference_info.github_url === null || selectedApp.reference_info.github_url.length === 0 ?
<a rel="norefferer" target="_blank" href={"https://github.com/frikky/shuffle-apps"} style={{textDecoration: "none", color: "#f86a3e"}}>
<img alt={`Documentation image for ${selectedApp.name}`} src={selectedApp.large_image} style={{width: 30, height: 30, border: "2px solid rgba(255,255,255,0.6)", borderRadius: theme.palette.borderRadius,}} />
<img alt={`Documentation image for ${selectedApp.name}`} src={selectedApp.large_image} style={{width: 30, height: 30, border: "2px solid rgba(255,255,255,0.6)", borderRadius: theme.palette.borderRadius, maxHeight: 30, maxWidth: 30, overflow: "hidden", fontSize: 8, }} />
</a>
:
<a rel="norefferer" target="_blank" href={selectedApp.reference_info.github_url} style={{textDecoration: "none", color: "#f86a3e"}}>
<img alt={`Documentation image for ${selectedApp.name}`} src={selectedApp.large_image} style={{width: 30, height: 30, border: "2px solid rgba(255,255,255,0.6)", borderRadius: theme.palette.borderRadius,}} />
<img alt={`Documentation image for ${selectedApp.name}`} src={selectedApp.large_image} style={{width: 30, height: 30, border: "2px solid rgba(255,255,255,0.6)", borderRadius: theme.palette.borderRadius, maxWidth: 30, maxHeight: 30, overflow: "hidden", fontSize: 8,}} />
</a>
}
</div>
+22 -5
View File
@@ -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)