partial specPath changes
This commit is contained in:
@@ -8,7 +8,8 @@ export default class ModelExample extends React.Component {
|
|||||||
schema: PropTypes.object.isRequired,
|
schema: PropTypes.object.isRequired,
|
||||||
example: PropTypes.any.isRequired,
|
example: PropTypes.any.isRequired,
|
||||||
isExecute: PropTypes.bool,
|
isExecute: PropTypes.bool,
|
||||||
getConfigs: PropTypes.func.isRequired
|
getConfigs: PropTypes.func.isRequired,
|
||||||
|
specPath: PropTypes.array.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props, context) {
|
constructor(props, context) {
|
||||||
@@ -32,7 +33,7 @@ export default class ModelExample extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let { getComponent, specSelectors, schema, example, isExecute, getConfigs } = this.props
|
let { getComponent, specSelectors, schema, example, isExecute, getConfigs, specPath } = this.props
|
||||||
let { defaultModelExpandDepth } = getConfigs()
|
let { defaultModelExpandDepth } = getConfigs()
|
||||||
const ModelWrapper = getComponent("ModelWrapper")
|
const ModelWrapper = getComponent("ModelWrapper")
|
||||||
|
|
||||||
@@ -53,7 +54,8 @@ export default class ModelExample extends React.Component {
|
|||||||
!isExecute && this.state.activeTab === "model" && <ModelWrapper schema={ schema }
|
!isExecute && this.state.activeTab === "model" && <ModelWrapper schema={ schema }
|
||||||
getComponent={ getComponent }
|
getComponent={ getComponent }
|
||||||
specSelectors={ specSelectors }
|
specSelectors={ specSelectors }
|
||||||
expandDepth={ defaultModelExpandDepth } />
|
expandDepth={ defaultModelExpandDepth }
|
||||||
|
specPath={specPath} />
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ export default class Model extends Component {
|
|||||||
isRef: PropTypes.bool,
|
isRef: PropTypes.bool,
|
||||||
required: PropTypes.bool,
|
required: PropTypes.bool,
|
||||||
expandDepth: PropTypes.number,
|
expandDepth: PropTypes.number,
|
||||||
depth: PropTypes.number
|
depth: PropTypes.number,
|
||||||
|
specPath: PropTypes.array.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
getModelName =( ref )=> {
|
getModelName =( ref )=> {
|
||||||
@@ -29,13 +30,13 @@ export default class Model extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let { getComponent, specSelectors, schema, required, name, isRef } = this.props
|
let { getComponent, specSelectors, schema, required, name, isRef, specPath } = this.props
|
||||||
const ObjectModel = getComponent("ObjectModel")
|
const ObjectModel = getComponent("ObjectModel")
|
||||||
const ArrayModel = getComponent("ArrayModel")
|
const ArrayModel = getComponent("ArrayModel")
|
||||||
const PrimitiveModel = getComponent("PrimitiveModel")
|
const PrimitiveModel = getComponent("PrimitiveModel")
|
||||||
let type = "object"
|
let type = "object"
|
||||||
let $$ref = schema && schema.get("$$ref")
|
let $$ref = schema && schema.get("$$ref")
|
||||||
|
|
||||||
// If we weren't passed a `name` but have a ref, grab the name from the ref
|
// If we weren't passed a `name` but have a ref, grab the name from the ref
|
||||||
if ( !name && $$ref ) {
|
if ( !name && $$ref ) {
|
||||||
name = this.getModelName( $$ref )
|
name = this.getModelName( $$ref )
|
||||||
@@ -44,15 +45,16 @@ export default class Model extends Component {
|
|||||||
if ( !schema && $$ref ) {
|
if ( !schema && $$ref ) {
|
||||||
schema = this.getRefSchema( name )
|
schema = this.getRefSchema( name )
|
||||||
}
|
}
|
||||||
|
|
||||||
const deprecated = specSelectors.isOAS3() && schema.get("deprecated")
|
const deprecated = specSelectors.isOAS3() && schema.get("deprecated")
|
||||||
isRef = isRef !== undefined ? isRef : !!$$ref
|
isRef = isRef !== undefined ? isRef : !!$$ref
|
||||||
type = schema && schema.get("type") || type
|
type = schema && schema.get("type") || type
|
||||||
|
|
||||||
switch(type) {
|
switch(type) {
|
||||||
case "object":
|
case "object":
|
||||||
return <ObjectModel
|
return <ObjectModel
|
||||||
className="object" { ...this.props }
|
className="object" { ...this.props }
|
||||||
|
specPath={specPath}
|
||||||
schema={ schema }
|
schema={ schema }
|
||||||
name={ name }
|
name={ name }
|
||||||
deprecated={deprecated}
|
deprecated={deprecated}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ export default class Models extends Component {
|
|||||||
<ModelWrapper name={ name }
|
<ModelWrapper name={ name }
|
||||||
expandDepth={ defaultModelExpandDepth }
|
expandDepth={ defaultModelExpandDepth }
|
||||||
schema={ model }
|
schema={ model }
|
||||||
|
specPath={["definitions", name]}
|
||||||
getComponent={ getComponent }
|
getComponent={ getComponent }
|
||||||
specSelectors={ specSelectors }/>
|
specSelectors={ specSelectors }/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,13 +13,13 @@ export default class ObjectModel extends Component {
|
|||||||
name: PropTypes.string,
|
name: PropTypes.string,
|
||||||
isRef: PropTypes.bool,
|
isRef: PropTypes.bool,
|
||||||
expandDepth: PropTypes.number,
|
expandDepth: PropTypes.number,
|
||||||
depth: PropTypes.number
|
depth: PropTypes.number,
|
||||||
|
specPath: PropTypes.object.isRequired
|
||||||
}
|
}
|
||||||
|
|
||||||
render(){
|
render(){
|
||||||
let { schema, name, isRef, getComponent, depth, expandDepth, ...otherProps } = this.props
|
let { schema, name, isRef, getComponent, depth, specPath, expandDepth, ...otherProps } = this.props
|
||||||
let { specSelectors } = otherProps
|
let { specSelectors } = otherProps
|
||||||
let { isOAS3 } = specSelectors
|
|
||||||
|
|
||||||
let description = schema.get("description")
|
let description = schema.get("description")
|
||||||
let properties = schema.get("properties")
|
let properties = schema.get("properties")
|
||||||
@@ -32,14 +32,13 @@ export default class ObjectModel extends Component {
|
|||||||
const Model = getComponent("Model")
|
const Model = getComponent("Model")
|
||||||
const ModelCollapse = getComponent("ModelCollapse")
|
const ModelCollapse = getComponent("ModelCollapse")
|
||||||
|
|
||||||
const JumpToPathSection = ({ name }) => {
|
const JumpToPathSection = () => {
|
||||||
const path = isOAS3 && isOAS3() ? `components.schemas.${name}` : `definitions.${name}`
|
return <span className="model-jump-to-path"><JumpToPath specPath={specPath} /></span>
|
||||||
return <span className="model-jump-to-path"><JumpToPath path={path} /></span>
|
|
||||||
}
|
}
|
||||||
const collapsedContent = (<span>
|
const collapsedContent = (<span>
|
||||||
<span>{ braceOpen }</span>...<span>{ braceClose }</span>
|
<span>{ braceOpen }</span>...<span>{ braceClose }</span>
|
||||||
{
|
{
|
||||||
isRef ? <JumpToPathSection name={ name }/> : ""
|
isRef ? <JumpToPathSection /> : ""
|
||||||
}
|
}
|
||||||
</span>)
|
</span>)
|
||||||
|
|
||||||
@@ -56,7 +55,7 @@ export default class ObjectModel extends Component {
|
|||||||
<ModelCollapse title={titleEl} collapsed={ depth > expandDepth } collapsedContent={ collapsedContent }>
|
<ModelCollapse title={titleEl} collapsed={ depth > expandDepth } collapsedContent={ collapsedContent }>
|
||||||
<span className="brace-open object">{ braceOpen }</span>
|
<span className="brace-open object">{ braceOpen }</span>
|
||||||
{
|
{
|
||||||
!isRef ? null : <JumpToPathSection name={ name }/>
|
!isRef ? null : <JumpToPathSection />
|
||||||
}
|
}
|
||||||
<span className="inner-object">
|
<span className="inner-object">
|
||||||
{
|
{
|
||||||
@@ -86,6 +85,7 @@ export default class ObjectModel extends Component {
|
|||||||
<Model key={ `object-${name}-${key}_${value}` } { ...otherProps }
|
<Model key={ `object-${name}-${key}_${value}` } { ...otherProps }
|
||||||
required={ isRequired }
|
required={ isRequired }
|
||||||
getComponent={ getComponent }
|
getComponent={ getComponent }
|
||||||
|
specPath={[...specPath, "properties", key]}
|
||||||
schema={ value }
|
schema={ value }
|
||||||
depth={ depth + 1 } />
|
depth={ depth + 1 } />
|
||||||
</td>
|
</td>
|
||||||
@@ -99,6 +99,7 @@ export default class ObjectModel extends Component {
|
|||||||
<td>
|
<td>
|
||||||
<Model { ...otherProps } required={ false }
|
<Model { ...otherProps } required={ false }
|
||||||
getComponent={ getComponent }
|
getComponent={ getComponent }
|
||||||
|
specPath={[...specPath, "additionalProperties"]}
|
||||||
schema={ additionalProperties }
|
schema={ additionalProperties }
|
||||||
depth={ depth + 1 } />
|
depth={ depth + 1 } />
|
||||||
</td>
|
</td>
|
||||||
@@ -112,6 +113,7 @@ export default class ObjectModel extends Component {
|
|||||||
{anyOf.map((schema, k) => {
|
{anyOf.map((schema, k) => {
|
||||||
return <div key={k}><Model { ...otherProps } required={ false }
|
return <div key={k}><Model { ...otherProps } required={ false }
|
||||||
getComponent={ getComponent }
|
getComponent={ getComponent }
|
||||||
|
specPath={[...specPath, "anyOf", k]}
|
||||||
schema={ schema }
|
schema={ schema }
|
||||||
depth={ depth + 1 } /></div>
|
depth={ depth + 1 } /></div>
|
||||||
})}
|
})}
|
||||||
@@ -126,6 +128,7 @@ export default class ObjectModel extends Component {
|
|||||||
{oneOf.map((schema, k) => {
|
{oneOf.map((schema, k) => {
|
||||||
return <div key={k}><Model { ...otherProps } required={ false }
|
return <div key={k}><Model { ...otherProps } required={ false }
|
||||||
getComponent={ getComponent }
|
getComponent={ getComponent }
|
||||||
|
specPath={[...specPath, "oneOf", k]}
|
||||||
schema={ schema }
|
schema={ schema }
|
||||||
depth={ depth + 1 } /></div>
|
depth={ depth + 1 } /></div>
|
||||||
})}
|
})}
|
||||||
@@ -140,6 +143,7 @@ export default class ObjectModel extends Component {
|
|||||||
{not.map((schema, k) => {
|
{not.map((schema, k) => {
|
||||||
return <div key={k}><Model { ...otherProps } required={ false }
|
return <div key={k}><Model { ...otherProps } required={ false }
|
||||||
getComponent={ getComponent }
|
getComponent={ getComponent }
|
||||||
|
specPath={[...specPath, "not", k]}
|
||||||
schema={ schema }
|
schema={ schema }
|
||||||
depth={ depth + 1 } /></div>
|
depth={ depth + 1 } /></div>
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export default class Operation extends PureComponent {
|
|||||||
showSummary: PropTypes.bool,
|
showSummary: PropTypes.bool,
|
||||||
|
|
||||||
isShownKey: CustomPropTypes.arrayOrString.isRequired,
|
isShownKey: CustomPropTypes.arrayOrString.isRequired,
|
||||||
jumpToKey: CustomPropTypes.arrayOrString.isRequired,
|
specPath: PropTypes.array.isRequired,
|
||||||
|
|
||||||
allowTryItOut: PropTypes.bool,
|
allowTryItOut: PropTypes.bool,
|
||||||
|
|
||||||
@@ -103,7 +103,7 @@ export default class Operation extends PureComponent {
|
|||||||
render() {
|
render() {
|
||||||
let {
|
let {
|
||||||
isShownKey,
|
isShownKey,
|
||||||
jumpToKey,
|
specPath,
|
||||||
path,
|
path,
|
||||||
method,
|
method,
|
||||||
operation,
|
operation,
|
||||||
@@ -161,7 +161,7 @@ export default class Operation extends PureComponent {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={deprecated ? "opblock opblock-deprecated" : shown ? `opblock opblock-${method} is-open` : `opblock opblock-${method}`} id={isShownKey.join("-")} >
|
<div className={deprecated ? "opblock opblock-deprecated" : shown ? `opblock opblock-${method} is-open` : `opblock opblock-${method}`} id={isShownKey.join("-")} >
|
||||||
<div className={`opblock-summary opblock-summary-${method}`} onClick={this.toggleShown} >
|
<div className={`opblock-summary opblock-summary-${method}`} onClick={this.toggleShown} > {/*TODO: convert this into a component, that can be wrapped and pulled in with getComponent */}
|
||||||
<span className="opblock-summary-method">{method.toUpperCase()}</span>
|
<span className="opblock-summary-method">{method.toUpperCase()}</span>
|
||||||
<span className={ deprecated ? "opblock-summary-path__deprecated" : "opblock-summary-path" } >
|
<span className={ deprecated ? "opblock-summary-path__deprecated" : "opblock-summary-path" } >
|
||||||
<a
|
<a
|
||||||
@@ -170,7 +170,7 @@ export default class Operation extends PureComponent {
|
|||||||
href={isDeepLinkingEnabled ? `#/${isShownKey[1]}/${isShownKey[2]}` : null}>
|
href={isDeepLinkingEnabled ? `#/${isShownKey[1]}/${isShownKey[2]}` : null}>
|
||||||
<span>{path}</span>
|
<span>{path}</span>
|
||||||
</a>
|
</a>
|
||||||
<JumpToPath path={jumpToKey} />
|
<JumpToPath path={specPath} /> {/*TODO: use wrapComponents here, swagger-ui doesn't care about jumpToPath */}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{ !showSummary ? null :
|
{ !showSummary ? null :
|
||||||
@@ -213,6 +213,7 @@ export default class Operation extends PureComponent {
|
|||||||
}
|
}
|
||||||
<Parameters
|
<Parameters
|
||||||
parameters={parameters}
|
parameters={parameters}
|
||||||
|
specPath={[...specPath, "parameters"]}
|
||||||
operation={operation}
|
operation={operation}
|
||||||
onChangeKey={onChangeKey}
|
onChangeKey={onChangeKey}
|
||||||
onTryoutClick = { this.onTryoutClick }
|
onTryoutClick = { this.onTryoutClick }
|
||||||
@@ -274,6 +275,7 @@ export default class Operation extends PureComponent {
|
|||||||
produces={ produces }
|
produces={ produces }
|
||||||
producesValue={ operation.get("produces_value") }
|
producesValue={ operation.get("produces_value") }
|
||||||
pathMethod={ [path, method] }
|
pathMethod={ [path, method] }
|
||||||
|
specPath={[...specPath, "responses"]}
|
||||||
displayRequestDuration={ displayRequestDuration }
|
displayRequestDuration={ displayRequestDuration }
|
||||||
fn={fn} />
|
fn={fn} />
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ export default class Operations extends React.Component {
|
|||||||
|
|
||||||
const path = op.get("path", "")
|
const path = op.get("path", "")
|
||||||
const method = op.get("method", "")
|
const method = op.get("method", "")
|
||||||
const jumpToKey = `paths.${path}.${method}`
|
const specPath = ["paths", path, method]
|
||||||
|
|
||||||
const operationId =
|
const operationId =
|
||||||
op.getIn(["operation", "operationId"]) || op.getIn(["operation", "__originalOperationId"]) || opId(op.get("operation"), path, method) || op.get("id")
|
op.getIn(["operation", "operationId"]) || op.getIn(["operation", "__originalOperationId"]) || opId(op.get("operation"), path, method) || op.get("id")
|
||||||
@@ -137,7 +137,7 @@ export default class Operations extends React.Component {
|
|||||||
{...op.toObject()}
|
{...op.toObject()}
|
||||||
|
|
||||||
isShownKey={isShownKey}
|
isShownKey={isShownKey}
|
||||||
jumpToKey={jumpToKey}
|
specPath={specPath}
|
||||||
showSummary={showSummary}
|
showSummary={showSummary}
|
||||||
key={isShownKey}
|
key={isShownKey}
|
||||||
response={ response }
|
response={ response }
|
||||||
|
|||||||
@@ -13,7 +13,8 @@ export default class ParameterRow extends Component {
|
|||||||
onChangeConsumes: PropTypes.func.isRequired,
|
onChangeConsumes: PropTypes.func.isRequired,
|
||||||
specSelectors: PropTypes.object.isRequired,
|
specSelectors: PropTypes.object.isRequired,
|
||||||
pathMethod: PropTypes.array.isRequired,
|
pathMethod: PropTypes.array.isRequired,
|
||||||
getConfigs: PropTypes.func.isRequired
|
getConfigs: PropTypes.func.isRequired,
|
||||||
|
specPath: PropTypes.array.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor(props, context) {
|
constructor(props, context) {
|
||||||
@@ -68,7 +69,7 @@ export default class ParameterRow extends Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let {param, onChange, getComponent, getConfigs, isExecute, fn, onChangeConsumes, specSelectors, pathMethod} = this.props
|
let {param, onChange, getComponent, getConfigs, isExecute, fn, onChangeConsumes, specSelectors, pathMethod, specPath} = this.props
|
||||||
|
|
||||||
let { isOAS3 } = specSelectors
|
let { isOAS3 } = specSelectors
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ export default class Parameters extends Component {
|
|||||||
onCancelClick: PropTypes.func,
|
onCancelClick: PropTypes.func,
|
||||||
onChangeKey: PropTypes.array,
|
onChangeKey: PropTypes.array,
|
||||||
pathMethod: PropTypes.array.isRequired,
|
pathMethod: PropTypes.array.isRequired,
|
||||||
getConfigs: PropTypes.func.isRequired
|
getConfigs: PropTypes.func.isRequired,
|
||||||
|
specPath: PropTypes.array.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -30,6 +31,7 @@ export default class Parameters extends Component {
|
|||||||
tryItOutEnabled: false,
|
tryItOutEnabled: false,
|
||||||
allowTryItOut: true,
|
allowTryItOut: true,
|
||||||
onChangeKey: [],
|
onChangeKey: [],
|
||||||
|
specPath: [],
|
||||||
}
|
}
|
||||||
|
|
||||||
onChange = ( param, value, isXml ) => {
|
onChange = ( param, value, isXml ) => {
|
||||||
@@ -58,6 +60,7 @@ export default class Parameters extends Component {
|
|||||||
parameters,
|
parameters,
|
||||||
allowTryItOut,
|
allowTryItOut,
|
||||||
tryItOutEnabled,
|
tryItOutEnabled,
|
||||||
|
specPath,
|
||||||
|
|
||||||
fn,
|
fn,
|
||||||
getComponent,
|
getComponent,
|
||||||
@@ -92,8 +95,10 @@ export default class Parameters extends Component {
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{
|
{
|
||||||
eachMap(parameters, (parameter) => (
|
eachMap(parameters, (parameter, i) => (
|
||||||
<ParameterRow fn={ fn }
|
<ParameterRow
|
||||||
|
fn={ fn }
|
||||||
|
specPath={[...specPath, i]}
|
||||||
getComponent={ getComponent }
|
getComponent={ getComponent }
|
||||||
getConfigs={ getConfigs }
|
getConfigs={ getConfigs }
|
||||||
param={ parameter }
|
param={ parameter }
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ export default class Response extends React.Component {
|
|||||||
getComponent: PropTypes.func.isRequired,
|
getComponent: PropTypes.func.isRequired,
|
||||||
getConfigs: PropTypes.func.isRequired,
|
getConfigs: PropTypes.func.isRequired,
|
||||||
specSelectors: PropTypes.object.isRequired,
|
specSelectors: PropTypes.object.isRequired,
|
||||||
|
specPath: PropTypes.array.isRequired,
|
||||||
fn: PropTypes.object.isRequired,
|
fn: PropTypes.object.isRequired,
|
||||||
contentType: PropTypes.string,
|
contentType: PropTypes.string,
|
||||||
controlsAcceptHeader: PropTypes.bool,
|
controlsAcceptHeader: PropTypes.bool,
|
||||||
@@ -72,6 +73,7 @@ export default class Response extends React.Component {
|
|||||||
code,
|
code,
|
||||||
response,
|
response,
|
||||||
className,
|
className,
|
||||||
|
specPath,
|
||||||
fn,
|
fn,
|
||||||
getComponent,
|
getComponent,
|
||||||
getConfigs,
|
getConfigs,
|
||||||
@@ -94,16 +96,19 @@ export default class Response extends React.Component {
|
|||||||
const ContentType = getComponent("contentType")
|
const ContentType = getComponent("contentType")
|
||||||
|
|
||||||
var sampleResponse
|
var sampleResponse
|
||||||
var schema
|
var schema, specPathWithPossibleSchema
|
||||||
|
|
||||||
if(isOAS3()) {
|
if(isOAS3()) {
|
||||||
let oas3SchemaForContentType = response.getIn(["content", this.state.responseContentType, "schema"])
|
const schemaPath = ["content", this.state.responseContentType, "schema"]
|
||||||
|
const oas3SchemaForContentType = response.getIn(schemaPath)
|
||||||
sampleResponse = oas3SchemaForContentType ? getSampleSchema(oas3SchemaForContentType.toJS(), this.state.responseContentType, {
|
sampleResponse = oas3SchemaForContentType ? getSampleSchema(oas3SchemaForContentType.toJS(), this.state.responseContentType, {
|
||||||
includeReadOnly: true
|
includeReadOnly: true
|
||||||
}) : null
|
}) : null
|
||||||
schema = oas3SchemaForContentType ? inferSchema(oas3SchemaForContentType.toJS()) : null
|
schema = oas3SchemaForContentType ? inferSchema(oas3SchemaForContentType.toJS()) : null
|
||||||
|
specPathWithPossibleSchema = oas3SchemaForContentType ? schemaPath : specPath
|
||||||
} else {
|
} else {
|
||||||
schema = inferSchema(response.toJS())
|
schema = inferSchema(response.toJS()) // TODO: don't convert back and forth. Lets just stick with immutable for inferSchema
|
||||||
|
specPathWithPossibleSchema = response.has("schema") ? [...specPath, "schema"] : specPath
|
||||||
sampleResponse = schema ? getSampleSchema(schema, contentType, {
|
sampleResponse = schema ? getSampleSchema(schema, contentType, {
|
||||||
includeReadOnly: true,
|
includeReadOnly: true,
|
||||||
includeWriteOnly: true // writeOnly has no filtering effect in swagger 2.0
|
includeWriteOnly: true // writeOnly has no filtering effect in swagger 2.0
|
||||||
@@ -145,6 +150,7 @@ export default class Response extends React.Component {
|
|||||||
|
|
||||||
{ example ? (
|
{ example ? (
|
||||||
<ModelExample
|
<ModelExample
|
||||||
|
specPath={specPathWithPossibleSchema}
|
||||||
getComponent={ getComponent }
|
getComponent={ getComponent }
|
||||||
getConfigs={ getConfigs }
|
getConfigs={ getConfigs }
|
||||||
specSelectors={ specSelectors }
|
specSelectors={ specSelectors }
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ export default class Responses extends React.Component {
|
|||||||
specActions: PropTypes.object.isRequired,
|
specActions: PropTypes.object.isRequired,
|
||||||
oas3Actions: PropTypes.object.isRequired,
|
oas3Actions: PropTypes.object.isRequired,
|
||||||
pathMethod: PropTypes.array.isRequired,
|
pathMethod: PropTypes.array.isRequired,
|
||||||
|
specPath: PropTypes.array.isRequired,
|
||||||
displayRequestDuration: PropTypes.bool.isRequired,
|
displayRequestDuration: PropTypes.bool.isRequired,
|
||||||
fn: PropTypes.object.isRequired
|
fn: PropTypes.object.isRequired
|
||||||
}
|
}
|
||||||
@@ -50,7 +51,8 @@ export default class Responses extends React.Component {
|
|||||||
specSelectors,
|
specSelectors,
|
||||||
fn,
|
fn,
|
||||||
producesValue,
|
producesValue,
|
||||||
displayRequestDuration
|
displayRequestDuration,
|
||||||
|
specPath,
|
||||||
} = this.props
|
} = this.props
|
||||||
let defaultCode = defaultStatusCode( responses )
|
let defaultCode = defaultStatusCode( responses )
|
||||||
|
|
||||||
@@ -104,9 +106,11 @@ export default class Responses extends React.Component {
|
|||||||
<tbody>
|
<tbody>
|
||||||
{
|
{
|
||||||
responses.entrySeq().map( ([code, response]) => {
|
responses.entrySeq().map( ([code, response]) => {
|
||||||
|
|
||||||
let className = tryItOutResponse && tryItOutResponse.get("status") == code ? "response_current" : ""
|
let className = tryItOutResponse && tryItOutResponse.get("status") == code ? "response_current" : ""
|
||||||
return (
|
return (
|
||||||
<Response key={ code }
|
<Response key={ code }
|
||||||
|
specPath={[...specPath, code]}
|
||||||
isDefault={defaultCode === code}
|
isDefault={defaultCode === code}
|
||||||
fn={fn}
|
fn={fn}
|
||||||
className={ className }
|
className={ className }
|
||||||
|
|||||||
Reference in New Issue
Block a user