mirror of
https://github.com/Redocly/redoc.git
synced 2025-02-07 13:30:33 +03:00
add showReadOnly and showWriteOnly options to object-description
This commit is contained in:
parent
a8f70377ab
commit
6935b16964
|
@ -9,6 +9,8 @@ import { MediaTypeSamples } from '../PayloadSamples/MediaTypeSamples';
|
||||||
export interface ObjectDescriptionProps {
|
export interface ObjectDescriptionProps {
|
||||||
schemaRef: string;
|
schemaRef: string;
|
||||||
examplesRef?: string;
|
examplesRef?: string;
|
||||||
|
showReadOnly?: boolean;
|
||||||
|
showWriteOnly?: boolean;
|
||||||
parser: OpenAPIParser;
|
parser: OpenAPIParser;
|
||||||
options: RedocNormalizedOptions;
|
options: RedocNormalizedOptions;
|
||||||
}
|
}
|
||||||
|
@ -53,11 +55,18 @@ export class ObjectDescription extends React.PureComponent<ObjectDescriptionProp
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
const { showReadOnly = true, showWriteOnly = false } = this.props;
|
||||||
|
console.log(this.props);
|
||||||
return (
|
return (
|
||||||
<Section>
|
<Section>
|
||||||
<Row>
|
<Row>
|
||||||
<MiddlePanel>
|
<MiddlePanel>
|
||||||
<Schema skipWriteOnly={true} key="schema" schema={this.mediaModel.schema} />
|
<Schema
|
||||||
|
skipWriteOnly={!showWriteOnly}
|
||||||
|
skipReadOnly={!showReadOnly}
|
||||||
|
key="schema"
|
||||||
|
schema={this.mediaModel.schema}
|
||||||
|
/>
|
||||||
</MiddlePanel>
|
</MiddlePanel>
|
||||||
<DarkRightPanel>
|
<DarkRightPanel>
|
||||||
<MediaTypeSamples mediaType={this.mediaModel} />
|
<MediaTypeSamples mediaType={this.mediaModel} />
|
||||||
|
|
Loading…
Reference in New Issue
Block a user