From e649b1b5bbdafe09ccbef6b2eecceb356cad23ed Mon Sep 17 00:00:00 2001 From: Tor Colvin Date: Wed, 7 Aug 2024 13:43:36 -0400 Subject: [PATCH] use built in info-override decorator --- .redocly.yaml | 7 +++-- .../plugins/decorators/excise-rbac-capella.js | 1 + .../decorators/replace-info-capella.js | 31 ------------------- docs/api/plugins/plugin.js | 2 -- 4 files changed, 5 insertions(+), 36 deletions(-) delete mode 100644 docs/api/plugins/decorators/replace-info-capella.js diff --git a/.redocly.yaml b/.redocly.yaml index f0318ba1ce..0c218a629a 100644 --- a/.redocly.yaml +++ b/.redocly.yaml @@ -28,14 +28,15 @@ apis: public-capella: root: "./docs/api/public.yaml" decorators: - remove-x-internal: on filter-out: property: x-capella value: false + info-override: + description: "App Services manages access and synchronization between Couchbase Lite and Couchbase Capella" + plugin/replace-description-capella: on plugin/replace-server-capella: serverUrl: 'https://{hostname}:4984' - plugin/replace-info-capella: - title: "App Services Public API" + remove-x-internal: on metric: root: "./docs/api/metric.yaml" decorators: diff --git a/docs/api/plugins/decorators/excise-rbac-capella.js b/docs/api/plugins/decorators/excise-rbac-capella.js index 49a9be4078..afe1feef3e 100644 --- a/docs/api/plugins/decorators/excise-rbac-capella.js +++ b/docs/api/plugins/decorators/excise-rbac-capella.js @@ -22,6 +22,7 @@ function ExciseRBACCapella() { return { Operation: { leave(Operation) { + // remove all text after first regex match idx = Operation.description.search(re); if (idx > 0) { Operation.description = Operation.description.substr(0, idx); diff --git a/docs/api/plugins/decorators/replace-info-capella.js b/docs/api/plugins/decorators/replace-info-capella.js deleted file mode 100644 index 189f804a04..0000000000 --- a/docs/api/plugins/decorators/replace-info-capella.js +++ /dev/null @@ -1,31 +0,0 @@ -/** - * Copyright 2024-Present Couchbase, Inc. - * - * Use of this software is governed by the Business Source License included - * in the file licenses/BSL-Couchbase.txt. As of the Change Date specified - * in that file, in accordance with the Business Source License, use of this - * software will be governed by the Apache License, Version 2.0, included in - * the file licenses/APL2.txt. - */ - -/** - * Modifies the title of openapi object to value passed in. - * @module ReplaceInfoCapella - */ - -module.exports = ReplaceInfoCapella; - -/** @type {import('@redocly/cli').OasDecorator} */ -function ReplaceInfoCapella({ title }) { - return { - Info: { - leave(Info) { - if (title) { - Info.title = title; - } - Info.description = - "App Services manages access and synchronization between Couchbase Lite and Couchbase Capella"; - }, - }, - }; -} diff --git a/docs/api/plugins/plugin.js b/docs/api/plugins/plugin.js index 2e422b5248..e2c875af07 100644 --- a/docs/api/plugins/plugin.js +++ b/docs/api/plugins/plugin.js @@ -10,7 +10,6 @@ const ExciseRBACCapella = require("./decorators/excise-rbac-capella.js"); const ReplaceDescriptionCapella = require("./decorators/replace-description-capella.js"); -const ReplaceInfoCapella = require("./decorators/replace-info-capella.js"); const ReplaceServerCapella = require("./decorators/replace-server-capella.js"); module.exports = { @@ -18,7 +17,6 @@ module.exports = { oas3: { "excise-rbac-capella": ExciseRBACCapella, "replace-description-capella": ReplaceDescriptionCapella, - "replace-info-capella": ReplaceInfoCapella, "replace-server-capella": ReplaceServerCapella, }, },