add specPath to parameters/requstBody
This commit is contained in:
@@ -10,6 +10,7 @@ const RequestBody = ({
|
||||
specSelectors,
|
||||
contentType,
|
||||
isExecute,
|
||||
specPath,
|
||||
onChange
|
||||
}) => {
|
||||
const Markdown = getComponent("Markdown")
|
||||
@@ -33,6 +34,7 @@ const RequestBody = ({
|
||||
expandDepth={1}
|
||||
isExecute={isExecute}
|
||||
schema={mediaTypeValue.get("schema")}
|
||||
specPath={[...specPath, "content", contentType]}
|
||||
example={<RequestBodyEditor
|
||||
requestBody={requestBody}
|
||||
onChange={onChange}
|
||||
@@ -52,7 +54,8 @@ RequestBody.propTypes = {
|
||||
specSelectors: PropTypes.object.isRequired,
|
||||
contentType: PropTypes.string.isRequired,
|
||||
isExecute: PropTypes.bool.isRequired,
|
||||
onChange: PropTypes.func.isRequired
|
||||
onChange: PropTypes.func.isRequired,
|
||||
specPath: PropTypes.array.isRequired
|
||||
}
|
||||
|
||||
export default RequestBody
|
||||
|
||||
@@ -28,6 +28,7 @@ class Parameters extends Component {
|
||||
fn: PropTypes.object.isRequired,
|
||||
tryItOutEnabled: PropTypes.bool,
|
||||
allowTryItOut: PropTypes.bool,
|
||||
specPath: PropTypes.array.isRequired,
|
||||
onTryoutClick: PropTypes.func,
|
||||
onCancelClick: PropTypes.func,
|
||||
onChangeKey: PropTypes.array,
|
||||
@@ -90,6 +91,7 @@ class Parameters extends Component {
|
||||
oas3Actions,
|
||||
oas3Selectors,
|
||||
pathMethod,
|
||||
specPath,
|
||||
operation
|
||||
} = this.props
|
||||
|
||||
@@ -103,6 +105,8 @@ class Parameters extends Component {
|
||||
const { isOAS3 } = specSelectors
|
||||
|
||||
const requestBody = operation.get("requestBody")
|
||||
const requestBodySpecPath = [...specPath.slice(0, -1), "requestBody"] // remove the "parameters" part
|
||||
|
||||
return (
|
||||
<div className="opblock-section">
|
||||
<div className="opblock-section-header">
|
||||
@@ -134,9 +138,10 @@ class Parameters extends Component {
|
||||
</thead>
|
||||
<tbody>
|
||||
{
|
||||
eachMap(parameters, (parameter) => (
|
||||
eachMap(parameters, (parameter, i) => (
|
||||
<ParameterRow fn={ fn }
|
||||
getComponent={ getComponent }
|
||||
specPath={[...specPath, i]}
|
||||
param={ parameter }
|
||||
key={ parameter.get( "name" ) }
|
||||
onChange={ this.onChange }
|
||||
@@ -172,6 +177,7 @@ class Parameters extends Component {
|
||||
</div>
|
||||
<div className="opblock-description-wrapper">
|
||||
<RequestBody
|
||||
specPath={requestBodySpecPath}
|
||||
requestBody={requestBody}
|
||||
isExecute={isExecute}
|
||||
onChange={(value) => {
|
||||
|
||||
Reference in New Issue
Block a user