Set writeOnly flags in correct places
This commit is contained in:
@@ -69,7 +69,9 @@ export default class ParamBody extends PureComponent {
|
||||
let { param, fn:{inferSchema} } = this.props
|
||||
let schema = inferSchema(param.toJS())
|
||||
|
||||
return getSampleSchema(schema, xml)
|
||||
return getSampleSchema(schema, xml, {
|
||||
includeWriteOnly: true
|
||||
})
|
||||
}
|
||||
|
||||
onChange = (value, { isEditBox, isXml }) => {
|
||||
|
||||
@@ -83,11 +83,16 @@ export default class Response extends React.Component {
|
||||
|
||||
if(isOAS3()) {
|
||||
let oas3SchemaForContentType = response.getIn(["content", this.state.responseContentType, "schema"])
|
||||
sampleResponse = oas3SchemaForContentType ? getSampleSchema(oas3SchemaForContentType.toJS(), this.state.responseContentType, { includeReadOnly: true }) : null
|
||||
sampleResponse = oas3SchemaForContentType ? getSampleSchema(oas3SchemaForContentType.toJS(), this.state.responseContentType, {
|
||||
includeReadOnly: true
|
||||
}) : null
|
||||
schema = oas3SchemaForContentType ? inferSchema(oas3SchemaForContentType.toJS()) : null
|
||||
} else {
|
||||
schema = inferSchema(response.toJS())
|
||||
sampleResponse = schema ? getSampleSchema(schema, contentType, { includeReadOnly: true }) : null
|
||||
sampleResponse = schema ? getSampleSchema(schema, contentType, {
|
||||
includeReadOnly: true,
|
||||
includeWriteOnly: true // writeOnly has no filtering effect in swagger 2.0
|
||||
}) : null
|
||||
}
|
||||
let example = getExampleComponent( sampleResponse, examples, HighlightCode )
|
||||
|
||||
|
||||
@@ -16,7 +16,9 @@ const RequestBody = ({ requestBody, getComponent, specSelectors, contentType })
|
||||
|
||||
const mediaTypeValue = requestBodyContent.get(contentType)
|
||||
|
||||
const sampleSchema = getSampleSchema(mediaTypeValue.get("schema").toJS(), contentType)
|
||||
const sampleSchema = getSampleSchema(mediaTypeValue.get("schema").toJS(), contentType, {
|
||||
includeWriteOnly: true
|
||||
})
|
||||
|
||||
return <div>
|
||||
{ requestBodyDescription &&
|
||||
|
||||
Reference in New Issue
Block a user