You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `templates` directory contains only our customized Java templates. Beside these customized templates,
4
+
the original templates of openapi-generator for Java are used. These can be found in the
5
+
official GitHub repo of the [openapi-generator](https://github.com/OpenAPITools/openapi-generator/tree/v7.14.0/modules/openapi-generator/src/main/resources/Java).
6
+
7
+
If you need to change something in the Java Generator, try always first to add
instead of overwriting existing templates. These ensure an easier upgrade process, to newer
10
+
versions of the openapi-generator.
11
+
12
+
If it's required to customize the original templates, you can copy them into this directory.
13
+
Try to minimize the customization as much as possible, to ensure, that we can easily upgrade
14
+
to newer versions in the future.
15
+
16
+
## Template adjustments
17
+
18
+
The following templates were customized but don't need to be adjusted when updating the Java SDK generator to a new a newer upstream version:
19
+
20
+
-`README.mustache`: This template was entirely overwritten. It has no technical impact on the Java SDK.
21
+
-`api_test.mustache`: This template had to be customized because of our changes to the DefaultApi and ApiClient classes.
22
+
23
+
The following templates were customized and need to be checked for adjustments when updating the Java SDK generator to a newer upstream version:
24
+
25
+
-`ApiCallback.mustache`: This template was customized use the `ApiException` class from the core module instead of the one generated by default.
26
+
-`ApiClient.mustache`: This template was customized to initialize the ApiClient with the CoreConfiguration to easily setup the KeyFlow Authentication and custom endpoints.
27
+
-`api.mustache`: This template was customized to initialize the DefaultApi with the CoreConfiguration to easily setup the KeyFlow Authentication and custom endpoints.
28
+
-`build.gradle.mustache`: This template was customized to allow the services to be subprojects in one big gradle project.
29
+
30
+
## Custom templates
31
+
32
+
The custom templates don't need to be adjusted when updating the Java SDK generator to a new a newer upstream version.
33
+
34
+
-`ApiClientTest.mustache`: Implements additional test cases.
35
+
-`serviceApi.mustache` and `serviceApiTest.mustache`: The classes generated by this template (`IaasApi`, `AlbApi`, ...) just inherit from the corresponding `DefaultApi` class. This way users of the Java SDK can use two STACKIT SDK modules for different STACKIT services within the same file without being forced to use fully qualified names for classes.
{{! BEGIN - Added CoreConfiguration field to ApiClient }}
142
+
{{!TEMPLATE CUSTOMIZATION - BEGIN - Added CoreConfiguration field to ApiClient }}
143
143
protected CoreConfiguration configuration;
144
-
{{! END - Added CoreConfiguration field to ApiClient }}
144
+
{{!TEMPLATE CUSTOMIZATION - END - Added CoreConfiguration field to ApiClient }}
145
145
146
146
{{#dynamicOperations}}
147
147
protected Map<String,ApiOperation> operationLookupMap = new HashMap<>();
148
148
149
149
{{/dynamicOperations}}
150
-
{{! BEGIN - Removed ApiClient constructor and replaced it with a custom constructors which create the ApiClient with the CoreConfiguration }}
150
+
{{!TEMPLATE CUSTOMIZATION - BEGIN - Removed ApiClient constructor and replaced it with a custom constructors which create the ApiClient with the CoreConfiguration }}
151
151
/**
152
152
* Basic constructor for ApiClient.
153
153
*
@@ -208,7 +208,7 @@ public class ApiClient {
208
208
this.httpClient = httpClient;
209
209
}
210
210
}
211
-
{{! END - Removed ApiClient constructor and replaced it with a custom constructors which create the ApiClient with the CoreConfiguration }}
211
+
{{!TEMPLATE CUSTOMIZATION - END - Removed ApiClient constructor and replaced it with a custom constructors which create the ApiClient with the CoreConfiguration }}
Copy file name to clipboardExpand all lines: languages/java/templates/README.mustache
-8Lines changed: 0 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,5 @@
1
1
# STACKIT Java SDK for {{appName}}
2
2
3
-
- API version: {{appVersion}}
4
-
5
-
{{{appDescriptionWithNewLines}}}
6
-
7
-
{{#infoUrl}}
8
-
For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}})
9
-
{{/infoUrl}}
10
-
11
3
This package is part of the STACKIT Java SDK. For additional information, please visit the [GitHub repository](https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}) of the SDK.
0 commit comments