diff --git a/src/core/components/model.jsx b/src/core/components/model.jsx index cea96191..db5e195d 100644 --- a/src/core/components/model.jsx +++ b/src/core/components/model.jsx @@ -34,9 +34,10 @@ class ObjectModel extends Component { render(){ let { schema, name, isRef, getComponent, depth, deprecated, ...props } = this.props - let { expandDepth } = this.props + let { expandDepth, specSelectors } = this.props const JumpToPath = getComponent("JumpToPath", true) let description = schema.get("description") + let nullable = schema.get("nullable") let properties = schema.get("properties") let additionalProperties = schema.get("additionalProperties") let title = schema.get("title") || name @@ -70,6 +71,12 @@ class ObjectModel extends Component { { description } } + { + (!specSelectors.isOAS3() || !nullable) ? null : + nullable + { nullable } + + } { !(properties && properties.size) ? null : properties.entrySeq().map( ([key, value]) => { diff --git a/src/core/components/response.jsx b/src/core/components/response.jsx index 086f86ed..67b5b969 100644 --- a/src/core/components/response.jsx +++ b/src/core/components/response.jsx @@ -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 (