From 54b464103146a1f5a69509a7f1c3a050aa5a73d6 Mon Sep 17 00:00:00 2001 From: Aniokrait Date: Thu, 11 Apr 2024 20:46:30 +0900 Subject: [PATCH 1/2] [html2]remove unnecessary mustache section --- .../main/resources/htmlDocs2/index.mustache | 78 +++++++++---------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache index 65c210b79292..5a55c156d65d 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache @@ -445,48 +445,46 @@
- {{#schema}} -
-
- -
- + var view = new JSONSchemaView(schema, 3); + $('#responses-{{baseName}}-{{nickname}}-{{code}}-schema-data').val(JSON.stringify(schema)); + var result = $('#responses-{{baseName}}-{{nickname}}-schema-{{code}}'); + result.empty(); + result.append(view.render()); + }); +
- {{#examples}} -
-
{{example}}
-
- {{/examples}} - {{/schema}} + +
+ {{#examples}} +
+
{{example}}
+
+ {{/examples}} {{#hasHeaders}}
From 43109837e8ba0cae1251fb1f7fe8cdd39c8d3230 Mon Sep 17 00:00:00 2001 From: Aniokrait Date: Fri, 12 Apr 2024 13:00:19 +0900 Subject: [PATCH 2/2] [html2]add null check --- .../src/main/resources/htmlDocs2/index.mustache | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache index 5a55c156d65d..2865781b099c 100644 --- a/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache +++ b/modules/openapi-generator/src/main/resources/htmlDocs2/index.mustache @@ -454,6 +454,9 @@ if (!schema) { schema = schemaWrapper.schema; } + if (schema == null) { + return; + } if (schema.$ref != null) { schema = defsParser.$refs.get(schema.$ref); Object.keys(schema.properties).forEach( (item) => {