mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-06 05:10:20 +03:00
fix: set reversing of read/write only by default
This commit is contained in:
parent
13b57acb86
commit
5fa68a1c9d
|
@ -248,7 +248,6 @@ You can use all of the following options with standalone version on <redoc> tag
|
|||
* `onlyRequiredInSamples` - shows only required fields in request samples.
|
||||
* `pathInMiddlePanel` - show path link and HTTP verb in the middle panel instead of the right one.
|
||||
* `requiredPropsFirst` - show required properties first ordered in the same order as in `required` array.
|
||||
* `reverseEventsReadWriteProps` - reverse readOnly/writeOnly schema key for webhooks and callbacks.
|
||||
* `scrollYOffset` - If set, specifies a vertical scroll-offset. This is often useful when there are fixed positioned elements at the top of the page, such as navbars, headers etc;
|
||||
`scrollYOffset` can be specified in various ways:
|
||||
* **number**: A fixed number of pixels to be used as offset.
|
||||
|
|
|
@ -42,7 +42,6 @@ export interface RedocRawOptions {
|
|||
maxDisplayedEnumValues?: number;
|
||||
ignoreNamedSchemas?: string[] | string;
|
||||
hideSchemaPattern?: boolean;
|
||||
reverseEventsReadWriteProps?: boolean;
|
||||
}
|
||||
|
||||
export function argValueToBoolean(val?: string | boolean, defaultValue?: boolean): boolean {
|
||||
|
@ -197,7 +196,6 @@ export class RedocNormalizedOptions {
|
|||
|
||||
ignoreNamedSchemas: Set<string>;
|
||||
hideSchemaPattern: boolean;
|
||||
reverseEventsReadWriteProps: boolean;
|
||||
|
||||
constructor(raw: RedocRawOptions, defaults: RedocRawOptions = {}) {
|
||||
raw = { ...defaults, ...raw };
|
||||
|
@ -259,6 +257,5 @@ export class RedocNormalizedOptions {
|
|||
: raw.ignoreNamedSchemas?.split(',').map((s) => s.trim());
|
||||
this.ignoreNamedSchemas = new Set(ignoreNamedSchemas);
|
||||
this.hideSchemaPattern = argValueToBoolean(raw.hideSchemaPattern);
|
||||
this.reverseEventsReadWriteProps = argValueToBoolean(raw.reverseEventsReadWriteProps);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -100,8 +100,7 @@ export class OperationModel implements IMenuItem {
|
|||
this.path = operationSpec.pathName;
|
||||
this.isCallback = isCallback;
|
||||
this.isWebhook = operationSpec.isWebhook;
|
||||
this.reverseEventsReadWriteProps = options.reverseEventsReadWriteProps &&
|
||||
(this.isCallback || this.isWebhook);
|
||||
this.reverseEventsReadWriteProps = this.isCallback || this.isWebhook;
|
||||
|
||||
this.name = getOperationSummary(operationSpec);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user