From b9b4f4ec0f8d16db066a04a684de21d6bb878c58 Mon Sep 17 00:00:00 2001 From: dblock Date: Wed, 30 Oct 2024 10:39:48 -0400 Subject: [PATCH] Add empty descriptions where missing. --- tools/src/merger/OpenApiMerger.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/src/merger/OpenApiMerger.ts b/tools/src/merger/OpenApiMerger.ts index ff8cd7d06..b1d8e9d81 100644 --- a/tools/src/merger/OpenApiMerger.ts +++ b/tools/src/merger/OpenApiMerger.ts @@ -53,6 +53,7 @@ export default class OpenApiMerger { this.#merge_schemas() this.#merge_namespaces() this.#sort_spec_keys() + this.#add_defaults() this.#generate_global_params() this.#generate_superseded_ops() this._merged = true @@ -134,6 +135,13 @@ export default class OpenApiMerger { }) } + #add_defaults(): void { + // Add default descriptions + Object.entries(this._spec.components.responses as Document).forEach(([_path, response_item]) => { + if (response_item.description === undefined) response_item.description = '' + }) + } + // Generate global parameters from _global_params.yaml file. #generate_global_params (): void { const gen = new GlobalParamsGenerator(this.root_folder)