@garanews: Fixed path issue in OpenAPI parser
This commit is contained in:
@@ -701,7 +701,7 @@ const AppCreator = (props) => {
|
||||
data.paths[item.url][item.method.toLowerCase()].parameters.push(newitem)
|
||||
//console.log(queryitem)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (item.paths.length > 0) {
|
||||
for (querykey in item.paths) {
|
||||
@@ -720,6 +720,30 @@ const AppCreator = (props) => {
|
||||
newitem.description = queryitem.description
|
||||
}
|
||||
|
||||
data.paths[item.url][item.method.toLowerCase()].parameters.push(newitem)
|
||||
//console.log(queryitem)
|
||||
}
|
||||
} else {
|
||||
// Always goes here if they didn't click anything :/
|
||||
const values = getCurrentPaths(item.url)
|
||||
const paths = values[0]
|
||||
|
||||
for (querykey in paths) {
|
||||
const queryitem = paths[querykey]
|
||||
newitem = {
|
||||
"in": "path",
|
||||
"name": queryitem,
|
||||
"description": "Generated by shuffler.io OpenAPI",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"type": "string",
|
||||
},
|
||||
}
|
||||
|
||||
if (queryitem.description !== undefined) {
|
||||
newitem.description = queryitem.description
|
||||
}
|
||||
|
||||
data.paths[item.url][item.method.toLowerCase()].parameters.push(newitem)
|
||||
//console.log(queryitem)
|
||||
}
|
||||
@@ -1220,7 +1244,7 @@ const AppCreator = (props) => {
|
||||
return errormessage
|
||||
}
|
||||
|
||||
const UrlPathParameters = () => {
|
||||
const getCurrentPaths = (urlPath) => {
|
||||
var paths = []
|
||||
var queries = []
|
||||
|
||||
@@ -1296,7 +1320,16 @@ const AppCreator = (props) => {
|
||||
}
|
||||
}
|
||||
|
||||
return [paths, queries]
|
||||
}
|
||||
|
||||
const UrlPathParameters = () => {
|
||||
const values = getCurrentPaths(urlPath)
|
||||
const paths = values[0]
|
||||
const queries = values[1]
|
||||
|
||||
if (currentAction.paths !== paths && urlPath.length > 0) {
|
||||
console.log("IN PATHS SETTER: !", paths)
|
||||
setActionField("paths", paths)
|
||||
}
|
||||
|
||||
@@ -1563,6 +1596,8 @@ const AppCreator = (props) => {
|
||||
</Button>
|
||||
<Button color="primary" variant="outlined" style={{borderRadius: "0px"}} onClick={() => {
|
||||
console.log(urlPathQueries)
|
||||
console.log(urlPath)
|
||||
// value={urlPath}
|
||||
const errors = getActionErrors()
|
||||
addActionToView(errors)
|
||||
setActionsModalOpen(false)
|
||||
@@ -1653,7 +1688,7 @@ const AppCreator = (props) => {
|
||||
<div style={{color: "white"}}>
|
||||
<h2>Test</h2>
|
||||
Test an action to see whether it performs in an expected way.
|
||||
<Link target="_blank" to="https://shuffler.io/docs/apps#testing" style={{textDecoration: "none", color: "#f85a3e"}}> TBD: Click here to learn more about testing</Link>.
|
||||
<a target="_blank" href="https://shuffler.io/docs/apps#testing" style={{textDecoration: "none", color: "#f85a3e"}}> TBD: Click here to learn more about testing</a>.
|
||||
<div>
|
||||
Test :)
|
||||
</div>
|
||||
@@ -1722,7 +1757,7 @@ const AppCreator = (props) => {
|
||||
</Breadcrumbs>
|
||||
<Paper style={boxStyle}>
|
||||
<h2 style={{marginBottom: "10px", color: "white"}}>General information</h2>
|
||||
<Link target="_blank" to="https://shuffler.io/docs/apps#create_openapi_app" style={{textDecoration: "none", color: "#f85a3e"}}>Click here to learn more about app creation</Link>
|
||||
<a target="_blank" href="https://shuffler.io/docs/apps#create_openapi_app" style={{textDecoration: "none", color: "#f85a3e"}}>Click here to learn more about app creation</a>
|
||||
<div style={{color: "white", flex: "1", display: "flex", flexDirection: "row"}}>
|
||||
<Tooltip title="Click to edit the app's image" placement="bottom">
|
||||
<div style={{flex: "1", margin: 10, border: "1px solid #f85a3e", cursor: "pointer", backgroundColor: inputColor, maxWidth: 174, maxHeight: 174}} onClick={() => {upload.click()}}>
|
||||
|
||||
Reference in New Issue
Block a user