From 5fa68a1c9dba122770e8db72dfb683d5f4cdb448 Mon Sep 17 00:00:00 2001 From: Andriy Zaleskyy Date: Fri, 27 Aug 2021 17:47:13 +0300 Subject: [PATCH] fix: set reversing of read/write only by default --- README.md | 1 - src/services/RedocNormalizedOptions.ts | 3 --- src/services/models/Operation.ts | 3 +-- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/README.md b/README.md index 5fb2ef90..6c63e3e6 100644 --- a/README.md +++ b/README.md @@ -248,7 +248,6 @@ You can use all of the following options with standalone version on 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. diff --git a/src/services/RedocNormalizedOptions.ts b/src/services/RedocNormalizedOptions.ts index 75c3b0dd..c2407b97 100644 --- a/src/services/RedocNormalizedOptions.ts +++ b/src/services/RedocNormalizedOptions.ts @@ -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; 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); } } diff --git a/src/services/models/Operation.ts b/src/services/models/Operation.ts index 7304f3a6..8d5e71bf 100644 --- a/src/services/models/Operation.ts +++ b/src/services/models/Operation.ts @@ -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);