mirror of
https://github.com/Redocly/redoc.git
synced 2025-01-31 10:04:08 +03:00
feat: new option hideSchemaTitles
This commit is contained in:
parent
4a25aaef69
commit
11cc4c4c3e
|
@ -27,7 +27,7 @@ export class FieldDetails extends React.PureComponent<FieldProps> {
|
||||||
static contextType = OptionsContext;
|
static contextType = OptionsContext;
|
||||||
render() {
|
render() {
|
||||||
const { showExamples, field, renderDiscriminatorSwitch } = this.props;
|
const { showExamples, field, renderDiscriminatorSwitch } = this.props;
|
||||||
const { enumSkipQuotes } = this.context;
|
const { enumSkipQuotes, hideSchemaTitles } = this.context;
|
||||||
|
|
||||||
const { schema, description, example, deprecated } = field;
|
const { schema, description, example, deprecated } = field;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ export class FieldDetails extends React.PureComponent<FieldProps> {
|
||||||
>{' '}
|
>{' '}
|
||||||
</TypeFormat>
|
</TypeFormat>
|
||||||
)}
|
)}
|
||||||
{schema.title && <TypeTitle> ({schema.title}) </TypeTitle>}
|
{schema.title && !hideSchemaTitles && <TypeTitle> ({schema.title}) </TypeTitle>}
|
||||||
<ConstraintsView constraints={schema.constraints} />
|
<ConstraintsView constraints={schema.constraints} />
|
||||||
{schema.nullable && <NullableLabel> {l('nullable')} </NullableLabel>}
|
{schema.nullable && <NullableLabel> {l('nullable')} </NullableLabel>}
|
||||||
{schema.pattern && <PatternLabel> {schema.pattern} </PatternLabel>}
|
{schema.pattern && <PatternLabel> {schema.pattern} </PatternLabel>}
|
||||||
|
|
|
@ -24,6 +24,7 @@ export interface RedocRawOptions {
|
||||||
hideSingleRequestSampleTab?: boolean | string;
|
hideSingleRequestSampleTab?: boolean | string;
|
||||||
menuToggle?: boolean | string;
|
menuToggle?: boolean | string;
|
||||||
jsonSampleExpandLevel?: number | string | 'all';
|
jsonSampleExpandLevel?: number | string | 'all';
|
||||||
|
hideSchemaTitles?: boolean | string;
|
||||||
|
|
||||||
unstable_ignoreMimeParameters?: boolean;
|
unstable_ignoreMimeParameters?: boolean;
|
||||||
|
|
||||||
|
@ -144,6 +145,7 @@ export class RedocNormalizedOptions {
|
||||||
menuToggle: boolean;
|
menuToggle: boolean;
|
||||||
jsonSampleExpandLevel: number;
|
jsonSampleExpandLevel: number;
|
||||||
enumSkipQuotes: boolean;
|
enumSkipQuotes: boolean;
|
||||||
|
hideSchemaTitles: boolean;
|
||||||
|
|
||||||
/* tslint:disable-next-line */
|
/* tslint:disable-next-line */
|
||||||
unstable_ignoreMimeParameters: boolean;
|
unstable_ignoreMimeParameters: boolean;
|
||||||
|
@ -182,6 +184,7 @@ export class RedocNormalizedOptions {
|
||||||
raw.jsonSampleExpandLevel,
|
raw.jsonSampleExpandLevel,
|
||||||
);
|
);
|
||||||
this.enumSkipQuotes = argValueToBoolean(raw.enumSkipQuotes);
|
this.enumSkipQuotes = argValueToBoolean(raw.enumSkipQuotes);
|
||||||
|
this.hideSchemaTitles = argValueToBoolean(raw.hideSchemaTitles);
|
||||||
|
|
||||||
this.unstable_ignoreMimeParameters = argValueToBoolean(raw.unstable_ignoreMimeParameters);
|
this.unstable_ignoreMimeParameters = argValueToBoolean(raw.unstable_ignoreMimeParameters);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user