1- From 50204d67fd96f7fd506c7c1b15ee38fbc5d3dc32 Mon Sep 17 00:00:00 2001
1+ From 98b3f154d75089db8525340286ecf1887bf5cfce Mon Sep 17 00:00:00 2001
22From: Alexandre Krispin <
[email protected] >
33Date: Thu, 26 Jan 2023 15:44:12 +0900
44Subject: [PATCH] Customize templates
55
66---
77 .../io/swagger/codegen/CodegenConstants.java | 3 ++
88 .../languages/PythonClientCodegen.java | 37 +++++++++++++++++--
9- .../src/main/resources/python/README.mustache | 17 + ++++++--
9+ .../src/main/resources/python/README.mustache | 16 ++++++--
1010 .../main/resources/python/api_doc.mustache | 24 +++++++++---
1111 .../main/resources/python/model_doc.mustache | 13 +++++--
12- 5 files changed, 78 insertions(+), 16 deletions(-)
12+ 5 files changed, 77 insertions(+), 16 deletions(-)
1313
1414diff --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
1515index d04e606ff..bf1714280 100644
@@ -97,10 +97,10 @@ index 9ef2e69e0..c5079eac1 100755
9797+ }
9898 }
9999diff --git a/modules/swagger-codegen/src/main/resources/python/README.mustache b/modules/swagger-codegen/src/main/resources/python/README.mustache
100- index 0cc707c1f..94f5a833c 100644
100+ index 0cc707c1f..d4992ede2 100644
101101--- a/modules/swagger-codegen/src/main/resources/python/README.mustache
102102+++ b/modules/swagger-codegen/src/main/resources/python/README.mustache
103- @@ -1,4 +1,15 @@
103+ @@ -1,4 +1,14 @@
104104- # {{{projectName}}}
105105+ ---
106106+ title: "Python API Client"
@@ -112,12 +112,11 @@ index 0cc707c1f..94f5a833c 100644
112112+ docIcon: "/docs/harbor-api.svg"
113113+ ---
114114+
115- +
116115+ # Harbor API Client
117116 {{#appDescription}}
118117 {{{appDescription}}}
119118 {{/appDescription}}
120- @@ -93,12 +104 ,12 @@ All URIs are relative to *{{basePath}}*
119+ @@ -93,12 +103 ,12 @@ All URIs are relative to *{{basePath}}*
121120
122121 Class | Method | HTTP request | Description
123122 ------------ | ------------- | ------------- | -------------
@@ -128,12 +127,12 @@ index 0cc707c1f..94f5a833c 100644
128127 ## Documentation For Models
129128
130129- {{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md)
131- + {{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{#lambda.lowercase}}{{{classname}}}{{/lambda.lowercase}})
130+ + {{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{#lambda.lowercase}}{{{classname}}}{{/lambda.lowercase}}/ )
132131 {{/model}}{{/models}}
133132
134133 ## Documentation For Authorization
135134diff --git a/modules/swagger-codegen/src/main/resources/python/api_doc.mustache b/modules/swagger-codegen/src/main/resources/python/api_doc.mustache
136- index 32c26d929..f3173a7df 100644
135+ index 32c26d929..688a42092 100644
137136--- a/modules/swagger-codegen/src/main/resources/python/api_doc.mustache
138137+++ b/modules/swagger-codegen/src/main/resources/python/api_doc.mustache
139138@@ -1,3 +1,10 @@
@@ -173,13 +172,13 @@ index 32c26d929..f3173a7df 100644
173172 Name | Type | Description | Notes
174173 ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
175174- {{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
176- + {{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[** {{dataType}}** ](../../{{modelDocPath}}/ {{#lambda.lowercase}}{{baseType}}{{/lambda.lowercase}}){{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
175+ + {{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}**[ {{dataType}}](../../{{modelDocPath}}{{#lambda.lowercase}}{{baseType}}{{/lambda.lowercase}})** {{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
177176 {{/allParams}}
178177
179178 ### Return type
180179
181180- {{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
182- + {{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}**[{{{returnType}}}](../../{{modelDocPath}}/ {{#lambda.lowercase}}{{returnBaseType}}{{/lambda.lowercase}})**{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
181+ + {{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}**[{{{returnType}}}](../../{{modelDocPath}}{{#lambda.lowercase}}{{returnBaseType}}{{/lambda.lowercase}})**{{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}}
183182
184183 ### Authorization
185184
@@ -197,7 +196,7 @@ index 32c26d929..f3173a7df 100644
197196 {{/operation}}
198197 {{/operations}}
199198diff --git a/modules/swagger-codegen/src/main/resources/python/model_doc.mustache b/modules/swagger-codegen/src/main/resources/python/model_doc.mustache
200- index 569550df3..d103ad055 100644
199+ index 569550df3..2ee9b5cc1 100644
201200--- a/modules/swagger-codegen/src/main/resources/python/model_doc.mustache
202201+++ b/modules/swagger-codegen/src/main/resources/python/model_doc.mustache
203202@@ -1,11 +1,18 @@
@@ -216,7 +215,7 @@ index 569550df3..d103ad055 100644
216215 Name | Type | Description | Notes
217216 ------------ | ------------- | ------------- | -------------
218217- {{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
219- + {{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[** {{datatype}}** ](../{{#lambda.lowercase}}{{complexType}}{{/lambda.lowercase}}){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
218+ + {{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}**[ {{datatype}}](../{{#lambda.lowercase}}{{complexType}}{{/lambda.lowercase}})** {{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}}
220219 {{/vars}}
221220
222221- [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
0 commit comments