File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -2,20 +2,24 @@ import React from "react"
22import PropTypes from "prop-types"
33import Im from "immutable"
44
5+ const propStyle = { color : "#999" , fontStyle : "italic" }
6+
57export default class Headers extends React . Component {
68
79 static propTypes = {
8- headers : PropTypes . object . isRequired
10+ headers : PropTypes . object . isRequired ,
11+ getComponent : PropTypes . func . isRequired
912 } ;
1013
1114 render ( ) {
1215
13- let { headers } = this . props
16+ let { headers, getComponent } = this . props
17+ const Property = getComponent ( "Property" )
1418
1519 if ( ! headers || ! headers . size )
1620 return null
1721
18- return (
22+ return (
1923 < div className = "headers-wrapper" >
2024 < h4 className = "headers__title" > Headers:</ h4 >
2125 < table className = "headers" >
@@ -35,7 +39,7 @@ export default class Headers extends React.Component {
3539 return ( < tr key = { key } >
3640 < td className = "header-col" > { key } </ td >
3741 < td className = "header-col" > { header . get ( "description" ) } </ td >
38- < td className = "header-col" > { header . get ( "type" ) } </ td >
42+ < td className = "header-col" > { header . get ( "schema" ) . get ( " type" ) } { header . get ( "schema" ) . get ( "example" ) ? < Property propKey = { "Example" } propVal = { header . get ( "schema" ) . get ( "example" ) } propStyle = { propStyle } /> : null } </ td >
3943 </ tr > )
4044 } ) . toArray ( )
4145 }
Original file line number Diff line number Diff line change @@ -153,7 +153,10 @@ export default class Response extends React.Component {
153153 ) : null }
154154
155155 { headers ? (
156- < Headers headers = { headers } />
156+ < Headers
157+ headers = { headers }
158+ getComponent = { getComponent }
159+ />
157160 ) : null }
158161
159162
You can’t perform that action at this time.
0 commit comments