Skip to content

Commit fb442f5

Browse files
author
Alexandre Krispin
committed
Fix primitive type displayed as complex one in templates
1 parent 86bc2d3 commit fb442f5

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

.github/workflows/docgen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
git clone https://github.com/swagger-api/swagger-codegen
2222
ls -l
2323
cd swagger-codegen
24-
git checkout 5d4f6db5aeb2c47856aa75dfb2bf579891a3a44b
24+
git checkout 09ea17323800a67a3a186de736d3360d4f4aa3c0
2525
wget https://raw.githubusercontent.com/container-registry/harbor-api-client/master/0001-Customize-templates.patch
2626
git config --global user.email "[email protected]"
2727
git config --global user.name "Github action"

0001-Customize-templates.patch

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
From 98b3f154d75089db8525340286ecf1887bf5cfce Mon Sep 17 00:00:00 2001
1+
From 6ebbd5b6f0271d1f2bfff20ace78d5a53b5cc450 Mon Sep 17 00:00:00 2001
22
From: Alexandre Krispin <[email protected]>
33
Date: Thu, 26 Jan 2023 15:44:12 +0900
44
Subject: [PATCH] Customize templates
55

66
---
77
.../io/swagger/codegen/CodegenConstants.java | 3 ++
8+
.../io/swagger/codegen/DefaultCodegen.java | 1 +
89
.../languages/PythonClientCodegen.java | 37 +++++++++++++++++--
910
.../src/main/resources/python/README.mustache | 16 ++++++--
1011
.../main/resources/python/api_doc.mustache | 24 +++++++++---
1112
.../main/resources/python/model_doc.mustache | 13 +++++--
12-
5 files changed, 77 insertions(+), 16 deletions(-)
13+
6 files changed, 78 insertions(+), 16 deletions(-)
1314

1415
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java
1516
index d04e606ff..bf1714280 100644
@@ -25,6 +26,18 @@ index d04e606ff..bf1714280 100644
2526
public static final String GIT_USER_ID = "gitUserId";
2627
public static final String GIT_USER_ID_DESC = "Git user ID, e.g. swagger-api.";
2728

29+
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java
30+
index 637fb68e7..0c30e0fcb 100644
31+
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java
32+
+++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java
33+
@@ -2631,6 +2631,7 @@ public class DefaultCodegen {
34+
p.baseType = pr.datatype;
35+
p.isContainer = true;
36+
p.isListContainer = true;
37+
+ p.isPrimitiveType = pr.isPrimitiveType;
38+
39+
// recursively add import
40+
while (pr != null) {
2841
diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java
2942
index 9ef2e69e0..c5079eac1 100755
3043
--- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java

0 commit comments

Comments
 (0)