mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 14:14:56 +03:00
fix: rename sampleCollapseLevel option to jsonSampleExpandLevel
Change README.md description
This commit is contained in:
parent
312c85a911
commit
2375077f8f
|
@ -242,7 +242,7 @@ You can use all of the following options with standalone version on <redoc> tag
|
|||
* `hideDownloadButton` - do not show "Download" spec button. **THIS DOESN'T MAKE YOUR SPEC PRIVATE**, it just hides the button.
|
||||
* `disableSearch` - disable search indexing and search box
|
||||
* `onlyRequiredInSamples` - shows only required fields in request samples.
|
||||
* `sampleCollapseLevel` - set the collapse level in response samples. Special value 'all' expand all response. Default value = 2.
|
||||
* `jsonSampleExpandLevel` - set the default expand level for JSON payload samples (responses and request body). Special value 'all' expands all levels. The default value is `2`.
|
||||
* `theme` - ReDoc theme. Not documented yet. For details check source code: [theme.ts](https://github.com/Redocly/redoc/blob/master/src/theme.ts)
|
||||
|
||||
## Advanced usage of standalone version
|
||||
|
|
|
@ -40,7 +40,7 @@ class Json extends React.PureComponent<JsonProps> {
|
|||
// tslint:disable-next-line
|
||||
ref={node => (this.node = node!)}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: jsonToHTML(this.props.data, options.sampleCollapseLevel),
|
||||
__html: jsonToHTML(this.props.data, options.jsonSampleExpandLevel),
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
|
|
@ -22,7 +22,7 @@ export interface RedocRawOptions {
|
|||
onlyRequiredInSamples?: boolean | string;
|
||||
showExtensions?: boolean | string | string[];
|
||||
hideSingleRequestSampleTab?: boolean | string;
|
||||
sampleCollapseLevel?: number | string | 'all';
|
||||
jsonSampleExpandLevel?: number | string | 'all';
|
||||
|
||||
unstable_ignoreMimeParameters?: boolean;
|
||||
|
||||
|
@ -136,7 +136,7 @@ export class RedocNormalizedOptions {
|
|||
onlyRequiredInSamples: boolean;
|
||||
showExtensions: boolean | string[];
|
||||
hideSingleRequestSampleTab: boolean;
|
||||
sampleCollapseLevel: number;
|
||||
jsonSampleExpandLevel: number;
|
||||
|
||||
/* tslint:disable-next-line */
|
||||
unstable_ignoreMimeParameters: boolean;
|
||||
|
@ -168,8 +168,8 @@ export class RedocNormalizedOptions {
|
|||
this.onlyRequiredInSamples = argValueToBoolean(raw.onlyRequiredInSamples);
|
||||
this.showExtensions = RedocNormalizedOptions.normalizeShowExtensions(raw.showExtensions);
|
||||
this.hideSingleRequestSampleTab = argValueToBoolean(raw.hideSingleRequestSampleTab);
|
||||
this.sampleCollapseLevel = RedocNormalizedOptions.normalizeSampleCollapseLevel(
|
||||
raw.sampleCollapseLevel,
|
||||
this.jsonSampleExpandLevel = RedocNormalizedOptions.normalizeSampleCollapseLevel(
|
||||
raw.jsonSampleExpandLevel,
|
||||
);
|
||||
|
||||
this.unstable_ignoreMimeParameters = argValueToBoolean(raw.unstable_ignoreMimeParameters);
|
||||
|
|
Loading…
Reference in New Issue
Block a user