Use <Operation> in callbacks
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import React from "react"
|
||||
|
||||
export default ({ callbacks, getComponent }) => {
|
||||
export default (props) => {
|
||||
let { callbacks, getComponent } = props
|
||||
const Markdown = getComponent("Markdown")
|
||||
const Operation = getComponent("operation", true)
|
||||
|
||||
if(!callbacks) {
|
||||
return <span>No callbacks</span>
|
||||
@@ -12,9 +14,14 @@ export default ({ callbacks, getComponent }) => {
|
||||
<h2>{callbackName}</h2>
|
||||
{ callback.map((pathItem, pathItemName) => {
|
||||
return <div>
|
||||
<h4>{pathItemName}</h4>
|
||||
{ pathItem.map((operation, method) => {
|
||||
return <pre>{JSON.stringify(operation)}</pre>
|
||||
return <Operation
|
||||
operation={operation}
|
||||
key={method}
|
||||
method={method}
|
||||
path={pathItemName}
|
||||
{...props}></Operation>
|
||||
// return <pre>{JSON.stringify(operation)}</pre>
|
||||
}) }
|
||||
</div>
|
||||
}) }
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { Component, PropTypes } from "react"
|
||||
import Im, { OrderedMap } from "immutable"
|
||||
import Im, { Map } from "immutable"
|
||||
import ImPropTypes from "react-immutable-proptypes"
|
||||
import { OAS3ComponentWrapFactory } from "../helpers"
|
||||
|
||||
@@ -146,7 +146,7 @@ class Parameters extends Component {
|
||||
</div> : "" }
|
||||
|
||||
{this.state.callbackVisible ? <div className="callbacks-container opblock-description-wrapper">
|
||||
<Callbacks callbacks={operation.get("callbacks")} />
|
||||
<Callbacks callbacks={Map(operation.get("callbacks"))} />
|
||||
</div> : "" }
|
||||
{
|
||||
requestBody && this.state.parametersVisible &&
|
||||
|
||||
Reference in New Issue
Block a user