MOAR rendering (improve media type detection; render object model

nullables)
This commit is contained in:
Kyle Shockey
2017-06-16 14:23:09 -07:00
parent 541f3e99b2
commit e3ae1eebfe
2 changed files with 16 additions and 2 deletions

View File

@@ -67,7 +67,14 @@ export default class Response extends React.Component {
const Markdown = getComponent( "Markdown" )
const OperationLink = getComponent("operationLink")
let sampleResponse = schema ? getSampleSchema(schema, contentType, { includeReadOnly: true }) : null
var sampleResponse
if(specSelectors.isOAS3()) {
let oas3SchemaForContentType = response.getIn(["content", contentType, "schema"])
sampleResponse = oas3SchemaForContentType ? getSampleSchema(oas3SchemaForContentType, contentType, { includeReadOnly: true }) : null
} else {
sampleResponse = schema ? getSampleSchema(schema, contentType, { includeReadOnly: true }) : null
}
let example = getExampleComponent( sampleResponse, examples, HighlightCode )
return (