@team-supercharge/oasg 16.3.0-feature-aspdotnetcore-generator-974dbeeb.0 → 16.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -27
- package/bin/merger.js +5 -3
- package/bin/oasg +4 -5
- package/config.schema.yml +0 -18
- package/package.json +1 -1
- package/targets/feign/templates/libraries/spring-cloud/pom-sb3.mustache +11 -4
- package/targets/feign/templates/libraries/spring-cloud/pom.mustache +8 -1
- package/targets/feign-kotlin/templates/libraries/spring-cloud/pom-sb3.mustache +4 -4
- package/targets/feign-kotlin/templates/libraries/spring-cloud/pom.mustache +7 -7
- package/targets/spring/templates/libraries/spring-boot/pom-sb3.mustache +22 -7
- package/targets/spring/templates/libraries/spring-boot/pom.mustache +19 -4
- package/targets/spring-kotlin/generator-config.json +1 -0
- package/targets/spring-kotlin/templates/libraries/spring-boot/pom-sb3.mustache +4 -4
- package/targets/spring-kotlin/templates/libraries/spring-boot/pom.mustache +7 -7
- package/targets/dotnet-webapi/generate.sh +0 -15
- package/targets/dotnet-webapi/generator-config.json +0 -18
- package/targets/dotnet-webapi/publish.sh +0 -16
- package/targets/feign/templates/libraries/spring-cloud/clientConfiguration.mustache +0 -118
package/README.md
CHANGED
@@ -110,14 +110,14 @@ The table below gives an overview of the changes (breaking, non-breaking, bug fi
|
|
110
110
|
| Component | | | | | | | | | | | | | | | | |
|
111
111
|
|------------------------------|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|
112
112
|
| **Internal** | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|
113
|
-
| _Core_
|
113
|
+
| _Core_ |✨ |🐛 |💥 |✨ |🐛 |✨ |➖ |✨ |🐛 |🐛 |➖ |💥 |💥 |✨ |💥 |🆕 |
|
114
114
|
| _Linter_ |🐛 |➖ |➖ |➖ |➖ |💥 |➖ |➖ |➖ |➖ |🐛 |➖ |✨ |💥 |🆕 |
|
115
115
|
| **Client Targets** | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|
116
116
|
| `android` |➖ |➖ |🐛 |💥 |➖ |➖ |💥 |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
|
117
|
-
| `angular`
|
117
|
+
| `angular` |✨ |➖ |🐛 |💥 |➖ |➖ |➖ |🐛 |➖ |➖ |➖ |💥 |➖ |➖ |➖ |🆕 |
|
118
118
|
| `dotnet` |➖ |➖ |🆕 |
|
119
|
-
| `feign`
|
120
|
-
| `feign-kotlin`
|
119
|
+
| `feign` |✨ |➖ |➖ |➖ |➖ |➖ |✨ |💥 |💥 |➖ |➖ |🐛 |🐛 |🆕 |
|
120
|
+
| `feign-kotlin` |✨ |➖ |➖ |➖ |➖ |➖ |🆕 |
|
121
121
|
| `flutter` |➖ |➖ |➖ |🆕 |
|
122
122
|
| `ios` |➖ |➖ |➖ |💥 |🐛 |➖ |➖ |➖ |✨ |➖ |💥 |➖ |➖ |✨ |🆕 |
|
123
123
|
| `kmp` |➖ |➖ |🆕 |
|
@@ -130,8 +130,8 @@ The table below gives an overview of the changes (breaking, non-breaking, bug fi
|
|
130
130
|
| `nestjs` |💥 |💥 |➖ |💥 |✨ |➖ |➖ |🐛 |➖ |➖ |✨ |🆕 |
|
131
131
|
| `python-fastapi` |➖ |➖ |🆕 |
|
132
132
|
| `python-fastapi-raw-request` |➖ |➖ |🆕 |
|
133
|
-
| `spring`
|
134
|
-
| `spring-kotlin`
|
133
|
+
| `spring` |✨ |➖ |➖ |➖ |➖ |➖ |✨ |💥 |💥 |➖ |➖ |➖ |✨ |➖ |🆕 |
|
134
|
+
| `spring-kotlin` |✨ |➖ |➖ |➖ |➖ |➖ |✨ |💥 |💥 |➖ |➖ |🐛 |✨ |➖ |🆕 |
|
135
135
|
| **Misc Targets** | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
|
136
136
|
| `contract-testing` |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
|
137
137
|
| `openapi` |➖ |➖ |➖ |➖ |💥 |➖ |➖ |✨ |➖ |🆕 |
|
@@ -1006,27 +1006,6 @@ Validations from OpenAPI spec:
|
|
1006
1006
|
| packageName | Name of the generated package | Y | - |
|
1007
1007
|
| generatorCustomArgs | Custom arguments of the generator (--global-property, --additional-properties) | N | - |
|
1008
1008
|
|
1009
|
-
#### `dotnet-webapi`
|
1010
|
-
|
1011
|
-
```json
|
1012
|
-
{
|
1013
|
-
"id": "dotnet-webapi",
|
1014
|
-
"type": "dotnet-webapi",
|
1015
|
-
"source": "source-merged",
|
1016
|
-
"sourceUrl": "https://api.nuget.org/v3/index.json",
|
1017
|
-
"apiKey": "apiKey",
|
1018
|
-
"packageName": "packageName",
|
1019
|
-
"generatorCustomArgs": "--global-property=supportingFiles,modelDocs --additional-properties=nullableReferenceTypes=false"
|
1020
|
-
}
|
1021
|
-
```
|
1022
|
-
|
1023
|
-
| Parameter | Description | Required | Default |
|
1024
|
-
| ------------------- | ------------------------------------------------------------------------------ | -------- | ------- |
|
1025
|
-
| sourceUrl | Url to where the package will be published | Y | - |
|
1026
|
-
| apiKey | Api key of nuget source | Y | - |
|
1027
|
-
| packageName | Name of the generated package | Y | - |
|
1028
|
-
| generatorCustomArgs | Custom arguments of the generator (--global-property, --additional-properties) | N | - |
|
1029
|
-
|
1030
1009
|
#### `postman`
|
1031
1010
|
|
1032
1011
|
```json
|
package/bin/merger.js
CHANGED
@@ -187,9 +187,11 @@ function mergeDocument(leftDoc, rightDoc) {
|
|
187
187
|
const mergedPaths = { ...leftDoc.paths, ...rightDoc.paths };
|
188
188
|
leftDoc.paths = mergedPaths;
|
189
189
|
|
190
|
-
// webhooks
|
191
|
-
|
192
|
-
|
190
|
+
// webhooks (optional, only in 3.1.0)
|
191
|
+
if (leftDoc.webhooks || rightDoc.webhooks) {
|
192
|
+
const mergedWebhooks = { ...leftDoc.webhooks, ...rightDoc.webhooks };
|
193
|
+
leftDoc.webhooks = mergedWebhooks;
|
194
|
+
}
|
193
195
|
|
194
196
|
// components
|
195
197
|
const mergedSchemas = { ...leftDoc.components.schemas, ...rightDoc.components.schemas };
|
package/bin/oasg
CHANGED
@@ -37,8 +37,8 @@ const DEFAULT_GENERATOR_MAPPING = {
|
|
37
37
|
// client targets
|
38
38
|
"android": { version: '7.0.1', generator: 'kotlin' },
|
39
39
|
"angular": { version: '7.11.0', generator: 'typescript-angular' },
|
40
|
-
"feign": { version: '7.0
|
41
|
-
"feign-kotlin": { version: '7.0
|
40
|
+
"feign": { version: '7.11.0', generator: 'spring' },
|
41
|
+
"feign-kotlin": { version: '7.11.0', generator: 'kotlin-spring' },
|
42
42
|
"flutter": { version: '7.0.1', generator: 'dart-dio' },
|
43
43
|
"ios": { version: '7.0.1', generator: 'swift5' },
|
44
44
|
"kmp": { version: '7.8.0', generator: 'kotlin' },
|
@@ -49,12 +49,11 @@ const DEFAULT_GENERATOR_MAPPING = {
|
|
49
49
|
"typescript-fetch": { version: '7.11.0', generator: 'typescript-fetch' },
|
50
50
|
// server targets
|
51
51
|
"nestjs": { version: '7.0.1', generator: 'typescript-angular' },
|
52
|
-
"spring": { version: '7.0
|
53
|
-
"spring-kotlin": { version: '7.0
|
52
|
+
"spring": { version: '7.11.0', generator: 'spring' },
|
53
|
+
"spring-kotlin": { version: '7.11.0', generator: 'kotlin-spring' },
|
54
54
|
"python-fastapi": { version: '7.8.0', generator: 'python-fastapi' },
|
55
55
|
"python-fastapi-raw-request": { version: '7.0.1', generator: 'python-fastapi' },
|
56
56
|
"dotnet": { version: '7.8.0', generator: 'csharp-functions' },
|
57
|
-
"dotnet-webapi": { version: '7.11.0', generator: 'aspnetcore' },
|
58
57
|
// misc targets
|
59
58
|
"contract-testing": { version: '4.3.1', generator: 'typescript-node' },
|
60
59
|
"openapi": { version: undefined, generator: undefined },
|
package/config.schema.yml
CHANGED
@@ -29,7 +29,6 @@ properties:
|
|
29
29
|
- $ref: '#/targets/Flutter'
|
30
30
|
- $ref: '#/targets/Kmp'
|
31
31
|
- $ref: '#/targets/Dotnet'
|
32
|
-
- $ref: '#/targets/DotnetWebApi'
|
33
32
|
- $ref: '#/targets/Postman'
|
34
33
|
- $ref: '#/targets/TypeScriptAxios'
|
35
34
|
- $ref: '#/targets/TypeScriptFetch'
|
@@ -414,23 +413,6 @@ targets:
|
|
414
413
|
- apiKey
|
415
414
|
- packageName
|
416
415
|
|
417
|
-
DotnetWebApi:
|
418
|
-
allOf:
|
419
|
-
- $ref: '#/targets/Base'
|
420
|
-
- properties:
|
421
|
-
type:
|
422
|
-
pattern: '^dotnet-webapi$'
|
423
|
-
sourceUrl:
|
424
|
-
type: string
|
425
|
-
apiKey:
|
426
|
-
type: string
|
427
|
-
packageName:
|
428
|
-
type: string
|
429
|
-
required:
|
430
|
-
- sourceUrl
|
431
|
-
- apiKey
|
432
|
-
- packageName
|
433
|
-
|
434
416
|
Kmp:
|
435
417
|
allOf:
|
436
418
|
- $ref: '#/targets/Base'
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@team-supercharge/oasg",
|
3
|
-
"version": "16.3.0
|
3
|
+
"version": "16.3.0",
|
4
4
|
"description": "Node-based tool to lint OpenAPI documents and generate clients, servers and documentation from them",
|
5
5
|
"author": "Supercharge",
|
6
6
|
"license": "MIT",
|
@@ -7,16 +7,16 @@
|
|
7
7
|
<name>{{artifactId}}</name>
|
8
8
|
<version>{{artifactVersion}}</version>
|
9
9
|
<properties>
|
10
|
-
<java.version>
|
10
|
+
<java.version>8</java.version>
|
11
11
|
<maven.compiler.source>${java.version}</maven.compiler.source>
|
12
12
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
13
13
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
14
14
|
{{#springDocDocumentationProvider}}
|
15
|
-
<springdoc.version>2.0
|
15
|
+
<springdoc.version>2.2.0</springdoc.version>
|
16
16
|
{{/springDocDocumentationProvider}}
|
17
17
|
{{^springDocDocumentationProvider}}
|
18
18
|
{{#swagger2AnnotationLibrary}}
|
19
|
-
<swagger-annotations.version>2.2.
|
19
|
+
<swagger-annotations.version>2.2.15</swagger-annotations.version>
|
20
20
|
{{/swagger2AnnotationLibrary}}
|
21
21
|
{{/springDocDocumentationProvider}}
|
22
22
|
</properties>
|
@@ -31,7 +31,7 @@
|
|
31
31
|
<parent>
|
32
32
|
<groupId>org.springframework.boot</groupId>
|
33
33
|
<artifactId>spring-boot-starter-parent</artifactId>
|
34
|
-
<version>3.
|
34
|
+
<version>3.1.3</version>
|
35
35
|
<relativePath/> <!-- lookup parent from repository -->
|
36
36
|
</parent>
|
37
37
|
{{/parentOverridden}}
|
@@ -145,6 +145,13 @@
|
|
145
145
|
<artifactId>spring-boot-starter-hateoas</artifactId>
|
146
146
|
</dependency>
|
147
147
|
{{/hateoas}}
|
148
|
+
{{#lombok}}
|
149
|
+
<dependency>
|
150
|
+
<groupId>org.projectlombok</groupId>
|
151
|
+
<artifactId>lombok</artifactId>
|
152
|
+
<optional>true</optional>
|
153
|
+
</dependency>
|
154
|
+
{{/lombok}}
|
148
155
|
{{#useBeanValidation}}
|
149
156
|
<dependency>
|
150
157
|
<groupId>org.springframework.boot</groupId>
|
@@ -39,7 +39,7 @@
|
|
39
39
|
<parent>
|
40
40
|
<groupId>org.springframework.boot</groupId>
|
41
41
|
<artifactId>spring-boot-starter-parent</artifactId>
|
42
|
-
<version>2.7.
|
42
|
+
<version>2.7.15</version>
|
43
43
|
<relativePath/> <!-- lookup parent from repository -->
|
44
44
|
</parent>
|
45
45
|
{{/parentOverridden}}
|
@@ -161,6 +161,13 @@
|
|
161
161
|
<artifactId>spring-boot-starter-hateoas</artifactId>
|
162
162
|
</dependency>
|
163
163
|
{{/hateoas}}
|
164
|
+
{{#lombok}}
|
165
|
+
<dependency>
|
166
|
+
<groupId>org.projectlombok</groupId>
|
167
|
+
<artifactId>lombok</artifactId>
|
168
|
+
<optional>true</optional>
|
169
|
+
</dependency>
|
170
|
+
{{/lombok}}
|
164
171
|
{{#useBeanValidation}}
|
165
172
|
<dependency>
|
166
173
|
<groupId>org.springframework.boot</groupId>
|
@@ -10,15 +10,15 @@
|
|
10
10
|
<properties>{{#reactive}}
|
11
11
|
<kotlinx-coroutines.version>1.6.1
|
12
12
|
</kotlinx-coroutines.version>{{/reactive}}{{#springDocDocumentationProvider}}{{#useSwaggerUI}}
|
13
|
-
<springdoc-openapi.version>2.0
|
13
|
+
<springdoc-openapi.version>2.2.0
|
14
14
|
</springdoc-openapi.version>{{/useSwaggerUI}}{{/springDocDocumentationProvider}}{{#springFoxDocumentationProvider}}
|
15
15
|
<springfox-swagger2.version>2.9.2
|
16
16
|
</springfox-swagger2.version>{{/springFoxDocumentationProvider}}{{#useSwaggerUI}}{{^springDocDocumentationProvider}}
|
17
|
-
<swagger-ui.version>
|
17
|
+
<swagger-ui.version>5.3.1
|
18
18
|
</swagger-ui.version>{{/springDocDocumentationProvider}}{{/useSwaggerUI}}{{^springFoxDocumentationProvider}}{{^springDocDocumentationProvider}}{{#swagger1AnnotationLibrary}}
|
19
19
|
<swagger-annotations.version>1.6.6
|
20
20
|
</swagger-annotations.version>{{/swagger1AnnotationLibrary}}{{#swagger2AnnotationLibrary}}
|
21
|
-
<swagger-annotations.version>2.2.
|
21
|
+
<swagger-annotations.version>2.2.15
|
22
22
|
</swagger-annotations.version>{{/swagger2AnnotationLibrary}}{{/springDocDocumentationProvider}}{{/springFoxDocumentationProvider}}
|
23
23
|
<findbugs-jsr305.version>3.0.2</findbugs-jsr305.version>
|
24
24
|
<jakarta-annotation.version>2.1.0</jakarta-annotation.version>
|
@@ -30,7 +30,7 @@
|
|
30
30
|
<parent>
|
31
31
|
<groupId>org.springframework.boot</groupId>
|
32
32
|
<artifactId>spring-boot-starter-parent</artifactId>
|
33
|
-
<version>3.
|
33
|
+
<version>3.1.3</version>
|
34
34
|
</parent>
|
35
35
|
<dependencyManagement>
|
36
36
|
<dependencies>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<swagger-annotations.version>1.6.6</swagger-annotations.version>{{/swagger1AnnotationLibrary}}{{#swagger2AnnotationLibrary}}
|
15
15
|
<swagger-annotations.version>2.2.0</swagger-annotations.version>{{/swagger2AnnotationLibrary}}{{/springDocDocumentationProvider}}{{/springFoxDocumentationProvider}}
|
16
16
|
<findbugs-jsr305.version>3.0.2</findbugs-jsr305.version>
|
17
|
-
<
|
17
|
+
<javax-annotation.version>1.3.2</javax-annotation.version>
|
18
18
|
<kotlin-test-junit5.version>1.6.21</kotlin-test-junit5.version>
|
19
19
|
|
20
20
|
<kotlin.version>1.6.21</kotlin.version>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<parent>
|
24
24
|
<groupId>org.springframework.boot</groupId>
|
25
25
|
<artifactId>spring-boot-starter-parent</artifactId>
|
26
|
-
<version>2.
|
26
|
+
<version>2.7.15</version>
|
27
27
|
</parent>
|
28
28
|
<dependencyManagement>
|
29
29
|
<dependencies>
|
@@ -204,13 +204,13 @@
|
|
204
204
|
{{#useBeanValidation}}
|
205
205
|
<!-- Bean Validation API support -->
|
206
206
|
<dependency>
|
207
|
-
<groupId>
|
208
|
-
<artifactId>
|
207
|
+
<groupId>javax.validation</groupId>
|
208
|
+
<artifactId>validation-api</artifactId>
|
209
209
|
</dependency>{{/useBeanValidation}}
|
210
210
|
<dependency>
|
211
|
-
<groupId>
|
212
|
-
<artifactId>
|
213
|
-
<version>${
|
211
|
+
<groupId>javax.annotation</groupId>
|
212
|
+
<artifactId>javax.annotation-api</artifactId>
|
213
|
+
<version>${javax-annotation.version}</version>
|
214
214
|
<scope>provided</scope>
|
215
215
|
</dependency>
|
216
216
|
<dependency>
|
@@ -12,18 +12,18 @@
|
|
12
12
|
<maven.compiler.target>${java.version}</maven.compiler.target>
|
13
13
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
14
14
|
{{#springDocDocumentationProvider}}
|
15
|
-
<springdoc.version>2.0
|
15
|
+
<springdoc.version>2.6.0</springdoc.version>
|
16
16
|
{{/springDocDocumentationProvider}}
|
17
17
|
{{^springDocDocumentationProvider}}
|
18
18
|
{{#swagger2AnnotationLibrary}}
|
19
|
-
<swagger-annotations.version>
|
19
|
+
<swagger-annotations.version>2.2.22</swagger-annotations.version>
|
20
20
|
{{/swagger2AnnotationLibrary}}
|
21
21
|
{{/springDocDocumentationProvider}}
|
22
22
|
{{#useSwaggerUI}}
|
23
|
-
<swagger-ui.version>
|
23
|
+
<swagger-ui.version>5.17.14</swagger-ui.version>
|
24
24
|
{{/useSwaggerUI}}
|
25
25
|
{{#virtualService}}
|
26
|
-
<virtualan.version>2.5.
|
26
|
+
<virtualan.version>2.5.5</virtualan.version>
|
27
27
|
{{/virtualService}}
|
28
28
|
</properties>
|
29
29
|
{{#parentOverridden}}
|
@@ -37,7 +37,7 @@
|
|
37
37
|
<parent>
|
38
38
|
<groupId>org.springframework.boot</groupId>
|
39
39
|
<artifactId>spring-boot-starter-parent</artifactId>
|
40
|
-
<version>3.
|
40
|
+
<version>3.1.3</version>
|
41
41
|
<relativePath/> <!-- lookup parent from repository -->
|
42
42
|
</parent>
|
43
43
|
{{/parentOverridden}}
|
@@ -79,11 +79,19 @@
|
|
79
79
|
<plugin>
|
80
80
|
<groupId>org.springframework.boot</groupId>
|
81
81
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
82
|
-
{{#classifier}}
|
83
82
|
<configuration>
|
83
|
+
{{#classifier}}
|
84
84
|
<classifier>{{{classifier}}}</classifier>
|
85
|
+
{{/classifier}}
|
86
|
+
{{#lombok}}
|
87
|
+
<excludes>
|
88
|
+
<exclude>
|
89
|
+
<groupId>org.projectlombok</groupId>
|
90
|
+
<artifactId>lombok</artifactId>
|
91
|
+
</exclude>
|
92
|
+
</excludes>
|
93
|
+
{{/lombok}}
|
85
94
|
</configuration>
|
86
|
-
{{/classifier}}
|
87
95
|
</plugin>
|
88
96
|
{{#apiFirst}}
|
89
97
|
<plugin>
|
@@ -234,6 +242,13 @@
|
|
234
242
|
<artifactId>spring-boot-starter-hateoas</artifactId>
|
235
243
|
</dependency>
|
236
244
|
{{/hateoas}}
|
245
|
+
{{#lombok}}
|
246
|
+
<dependency>
|
247
|
+
<groupId>org.projectlombok</groupId>
|
248
|
+
<artifactId>lombok</artifactId>
|
249
|
+
<optional>true</optional>
|
250
|
+
</dependency>
|
251
|
+
{{/lombok}}
|
237
252
|
<dependency>
|
238
253
|
<groupId>com.fasterxml.jackson.core</groupId>
|
239
254
|
<artifactId>jackson-databind</artifactId>
|
@@ -31,7 +31,7 @@
|
|
31
31
|
<virtualan.version>2.5.2</virtualan.version>
|
32
32
|
{{/virtualService}}
|
33
33
|
{{#useSwaggerUI}}
|
34
|
-
<swagger-ui.version>
|
34
|
+
<swagger-ui.version>5.3.1</swagger-ui.version>
|
35
35
|
{{/useSwaggerUI}}
|
36
36
|
</properties>
|
37
37
|
{{#parentOverridden}}
|
@@ -45,7 +45,7 @@
|
|
45
45
|
<parent>
|
46
46
|
<groupId>org.springframework.boot</groupId>
|
47
47
|
<artifactId>spring-boot-starter-parent</artifactId>
|
48
|
-
<version>{{#springFoxDocumentationProvider}}2.5.14{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}2.7.
|
48
|
+
<version>{{#springFoxDocumentationProvider}}2.5.14{{/springFoxDocumentationProvider}}{{^springFoxDocumentationProvider}}2.7.15{{/springFoxDocumentationProvider}}</version>
|
49
49
|
<relativePath/> <!-- lookup parent from repository -->
|
50
50
|
</parent>
|
51
51
|
{{/parentOverridden}}
|
@@ -72,11 +72,19 @@
|
|
72
72
|
<plugin>
|
73
73
|
<groupId>org.springframework.boot</groupId>
|
74
74
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
75
|
-
{{#classifier}}
|
76
75
|
<configuration>
|
76
|
+
{{#classifier}}
|
77
77
|
<classifier>{{{classifier}}}</classifier>
|
78
|
-
</configuration>
|
79
78
|
{{/classifier}}
|
79
|
+
{{#lombok}}
|
80
|
+
<excludes>
|
81
|
+
<exclude>
|
82
|
+
<groupId>org.projectlombok</groupId>
|
83
|
+
<artifactId>lombok</artifactId>
|
84
|
+
</exclude>
|
85
|
+
</excludes>
|
86
|
+
{{/lombok}}
|
87
|
+
</configuration>
|
80
88
|
</plugin>
|
81
89
|
{{#apiFirst}}
|
82
90
|
<plugin>
|
@@ -244,6 +252,13 @@
|
|
244
252
|
<artifactId>spring-boot-starter-hateoas</artifactId>
|
245
253
|
</dependency>
|
246
254
|
{{/hateoas}}
|
255
|
+
{{#lombok}}
|
256
|
+
<dependency>
|
257
|
+
<groupId>org.projectlombok</groupId>
|
258
|
+
<artifactId>lombok</artifactId>
|
259
|
+
<optional>true</optional>
|
260
|
+
</dependency>
|
261
|
+
{{/lombok}}
|
247
262
|
<dependency>
|
248
263
|
<groupId>com.fasterxml.jackson.core</groupId>
|
249
264
|
<artifactId>jackson-databind</artifactId>
|
@@ -8,11 +8,11 @@
|
|
8
8
|
<version>{{artifactVersion}}</version>
|
9
9
|
<properties>{{#reactive}}
|
10
10
|
<kotlinx-coroutines.version>1.6.1</kotlinx-coroutines.version>{{/reactive}}{{#springDocDocumentationProvider}}{{#useSwaggerUI}}
|
11
|
-
<springdoc-openapi.version>2.0
|
11
|
+
<springdoc-openapi.version>2.2.0</springdoc-openapi.version>{{/useSwaggerUI}}{{/springDocDocumentationProvider}}{{#springFoxDocumentationProvider}}
|
12
12
|
<springfox-swagger2.version>2.9.2</springfox-swagger2.version>{{/springFoxDocumentationProvider}}{{#useSwaggerUI}}{{^springDocDocumentationProvider}}
|
13
|
-
<swagger-ui.version>
|
13
|
+
<swagger-ui.version>5.3.1</swagger-ui.version>{{/springDocDocumentationProvider}}{{/useSwaggerUI}}{{^springFoxDocumentationProvider}}{{^springDocDocumentationProvider}}{{#swagger1AnnotationLibrary}}
|
14
14
|
<swagger-annotations.version>1.6.6</swagger-annotations.version>{{/swagger1AnnotationLibrary}}{{#swagger2AnnotationLibrary}}
|
15
|
-
<swagger-annotations.version>2.2.
|
15
|
+
<swagger-annotations.version>2.2.15</swagger-annotations.version>{{/swagger2AnnotationLibrary}}{{/springDocDocumentationProvider}}{{/springFoxDocumentationProvider}}
|
16
16
|
<findbugs-jsr305.version>3.0.2</findbugs-jsr305.version>
|
17
17
|
<jakarta-annotation.version>2.1.0</jakarta-annotation.version>
|
18
18
|
<kotlin-test-junit5.version>1.7.10</kotlin-test-junit5.version>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<parent>
|
24
24
|
<groupId>org.springframework.boot</groupId>
|
25
25
|
<artifactId>spring-boot-starter-parent</artifactId>
|
26
|
-
<version>3.
|
26
|
+
<version>3.1.3</version>
|
27
27
|
</parent>
|
28
28
|
<repositories>
|
29
29
|
<repository>
|
@@ -14,7 +14,7 @@
|
|
14
14
|
<swagger-annotations.version>1.6.6</swagger-annotations.version>{{/swagger1AnnotationLibrary}}{{#swagger2AnnotationLibrary}}
|
15
15
|
<swagger-annotations.version>2.2.0</swagger-annotations.version>{{/swagger2AnnotationLibrary}}{{/springDocDocumentationProvider}}{{/springFoxDocumentationProvider}}
|
16
16
|
<findbugs-jsr305.version>3.0.2</findbugs-jsr305.version>
|
17
|
-
<
|
17
|
+
<javax-annotation.version>1.3.2</javax-annotation.version>
|
18
18
|
<kotlin-test-junit5.version>1.6.21</kotlin-test-junit5.version>
|
19
19
|
|
20
20
|
<kotlin.version>1.6.21</kotlin.version>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<parent>
|
24
24
|
<groupId>org.springframework.boot</groupId>
|
25
25
|
<artifactId>spring-boot-starter-parent</artifactId>
|
26
|
-
<version>2.
|
26
|
+
<version>2.7.15</version>
|
27
27
|
</parent>
|
28
28
|
<build>
|
29
29
|
<sourceDirectory>${project.basedir}/src/main/kotlin</sourceDirectory>
|
@@ -181,13 +181,13 @@
|
|
181
181
|
{{#useBeanValidation}}
|
182
182
|
<!-- Bean Validation API support -->
|
183
183
|
<dependency>
|
184
|
-
<groupId>
|
185
|
-
<artifactId>
|
184
|
+
<groupId>javax.validation</groupId>
|
185
|
+
<artifactId>validation-api</artifactId>
|
186
186
|
</dependency>{{/useBeanValidation}}
|
187
187
|
<dependency>
|
188
|
-
<groupId>
|
189
|
-
<artifactId>
|
190
|
-
<version>${
|
188
|
+
<groupId>javax.annotation</groupId>
|
189
|
+
<artifactId>javax.annotation-api</artifactId>
|
190
|
+
<version>${javax-annotation.version}</version>
|
191
191
|
<scope>provided</scope>
|
192
192
|
</dependency>
|
193
193
|
<dependency>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
source $(dirname "$0")/../common.sh
|
4
|
-
|
5
|
-
rm -rf out/$targetId
|
6
|
-
mkdir -p out/$targetId
|
7
|
-
|
8
|
-
java -jar $binary generate \
|
9
|
-
-g $generatorId \
|
10
|
-
-i $openApiFile \
|
11
|
-
-t $templateDir \
|
12
|
-
-o out/$targetId \
|
13
|
-
-c $(dirname "$0")/generator-config.json \
|
14
|
-
-p "packageVersion=$version,packageName=$packageName" \
|
15
|
-
$generatorCustomArgs
|
@@ -1,18 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"inlineSchemaOptions": {
|
3
|
-
"ARRAY_ITEM_SUFFIX": "",
|
4
|
-
"MAP_ITEM_SUFFIX": "",
|
5
|
-
"SKIP_SCHEMA_REUSE": "true"
|
6
|
-
},
|
7
|
-
"additionalProperties": {
|
8
|
-
"aspnetCoreVersion": "8.0",
|
9
|
-
"operationIsAsync": true,
|
10
|
-
"buildTarget": "library",
|
11
|
-
"generateBody": false,
|
12
|
-
"useDateTimeOffset": true,
|
13
|
-
"nullableReferenceTypes": true,
|
14
|
-
"operationResultTask": true,
|
15
|
-
"enumNameSuffix": "",
|
16
|
-
"enumValueSuffix": ""
|
17
|
-
}
|
18
|
-
}
|
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
source $(dirname "$0")/../common.sh
|
4
|
-
|
5
|
-
cd out/$targetId
|
6
|
-
|
7
|
-
# pack
|
8
|
-
dotnet restore
|
9
|
-
dotnet build -c Release
|
10
|
-
dotnet pack -c Release -p:Version=$version -p:IsPackable=true
|
11
|
-
|
12
|
-
# publish
|
13
|
-
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?><configuration></configuration>" > nuget.config
|
14
|
-
nuget push "src/**/bin/Release/*.nupkg" -ConfigFile nuget.config -ApiKey "${apiKey}" -Source ${sourceUrl}
|
15
|
-
|
16
|
-
cd ../..
|
@@ -1,118 +0,0 @@
|
|
1
|
-
{{! import ConditionalOnProperty if any auth methods are anbled }}
|
2
|
-
package {{configPackage}};
|
3
|
-
|
4
|
-
{{#authMethods}}
|
5
|
-
{{#isBasicBasic}}
|
6
|
-
import feign.auth.BasicAuthRequestInterceptor;
|
7
|
-
{{^hasApiKeyMethods}}
|
8
|
-
import org.springframework.beans.factory.annotation.Value;
|
9
|
-
{{/hasApiKeyMethods}}
|
10
|
-
{{/isBasicBasic}}
|
11
|
-
{{/authMethods}}
|
12
|
-
{{#hasAuthMethods}}
|
13
|
-
import org.springframework.context.annotation.Bean;
|
14
|
-
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
15
|
-
{{#hasApiKeyMethods}}
|
16
|
-
import org.springframework.beans.factory.annotation.Value;
|
17
|
-
{{/hasApiKeyMethods}}
|
18
|
-
{{#hasOAuthMethods}}
|
19
|
-
import org.springframework.security.authentication.AnonymousAuthenticationToken;
|
20
|
-
import org.springframework.security.oauth2.client.AuthorizedClientServiceOAuth2AuthorizedClientManager;
|
21
|
-
import org.springframework.security.oauth2.client.OAuth2AuthorizeRequest;
|
22
|
-
import org.springframework.security.oauth2.client.OAuth2AuthorizedClient;
|
23
|
-
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientManager;
|
24
|
-
import org.springframework.security.oauth2.client.OAuth2AuthorizedClientService;
|
25
|
-
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
|
26
|
-
import org.springframework.security.oauth2.core.OAuth2AuthenticationException;
|
27
|
-
import org.springframework.security.oauth2.core.OAuth2AccessToken;
|
28
|
-
import org.springframework.security.core.authority.AuthorityUtils;
|
29
|
-
import org.springframework.http.HttpHeaders;
|
30
|
-
|
31
|
-
import feign.RequestInterceptor;
|
32
|
-
import feign.RequestTemplate;
|
33
|
-
|
34
|
-
{{/hasOAuthMethods}}
|
35
|
-
{{/hasAuthMethods}}
|
36
|
-
import org.springframework.context.annotation.Configuration;
|
37
|
-
|
38
|
-
|
39
|
-
@Configuration
|
40
|
-
public class ClientConfiguration {
|
41
|
-
|
42
|
-
{{#authMethods}}
|
43
|
-
{{#isBasicBasic}}
|
44
|
-
@Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.username:{{closebrace}}")
|
45
|
-
private String {{{name}}}Username;
|
46
|
-
|
47
|
-
@Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.password:{{closebrace}}")
|
48
|
-
private String {{{name}}}Password;
|
49
|
-
|
50
|
-
@Bean
|
51
|
-
@ConditionalOnProperty(name = "{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.username")
|
52
|
-
public BasicAuthRequestInterceptor {{{name}}}RequestInterceptor() {
|
53
|
-
return new BasicAuthRequestInterceptor(this.{{{name}}}Username, this.{{{name}}}Password);
|
54
|
-
}
|
55
|
-
|
56
|
-
{{/isBasicBasic}}
|
57
|
-
{{#isApiKey}}
|
58
|
-
@Value("${{openbrace}}{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.key:{{closebrace}}")
|
59
|
-
private String {{{name}}}Key;
|
60
|
-
|
61
|
-
@Bean
|
62
|
-
@ConditionalOnProperty(name = "{{#lambda.lowercase}}{{{title}}}{{/lambda.lowercase}}.security.{{{name}}}.key")
|
63
|
-
public ApiKeyRequestInterceptor {{{name}}}RequestInterceptor() {
|
64
|
-
return new ApiKeyRequestInterceptor({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{{keyParamName}}}", this.{{{name}}}Key);
|
65
|
-
}
|
66
|
-
|
67
|
-
{{/isApiKey}}
|
68
|
-
{{#isOAuth}}
|
69
|
-
private static final String CLIENT_PRINCIPAL_{{#lambda.uppercase}}{{{flow}}}{{/lambda.uppercase}} = "oauth2FeignClient";
|
70
|
-
|
71
|
-
@Bean
|
72
|
-
@ConditionalOnProperty( prefix = "spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}", name = "enabled", havingValue = "true" )
|
73
|
-
public OAuth2RequestInterceptor {{{flow}}}OAuth2RequestInterceptor(final OAuth2AuthorizedClientManager {{{flow}}}AuthorizedClientManager ) {
|
74
|
-
return new OAuth2RequestInterceptor(OAuth2AuthorizeRequest.withClientRegistrationId("{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}")
|
75
|
-
.principal( new AnonymousAuthenticationToken( CLIENT_PRINCIPAL_{{#lambda.uppercase}}{{{flow}}}{{/lambda.uppercase}}, CLIENT_PRINCIPAL_{{#lambda.uppercase}}{{{flow}}}{{/lambda.uppercase}}, AuthorityUtils.createAuthorityList( "ROLE_ANONYMOUS" ) ) )
|
76
|
-
.build(), {{{flow}}}AuthorizedClientManager );
|
77
|
-
}
|
78
|
-
|
79
|
-
@Bean
|
80
|
-
@ConditionalOnProperty( prefix = "spring.security.oauth2.client.registration.{{{name}}}{{#lambda.pascalcase}}{{{flow}}}{{/lambda.pascalcase}}", name = "enabled", havingValue = "true" )
|
81
|
-
public OAuth2AuthorizedClientManager {{{flow}}}AuthorizedClientManager(ClientRegistrationRepository clientRegistrationRepository,
|
82
|
-
OAuth2AuthorizedClientService authorizedClientService ) {
|
83
|
-
return new AuthorizedClientServiceOAuth2AuthorizedClientManager( clientRegistrationRepository, authorizedClientService );
|
84
|
-
}
|
85
|
-
{{/isOAuth}}
|
86
|
-
{{/authMethods}}
|
87
|
-
{{#hasOAuthMethods}}
|
88
|
-
public static class OAuth2RequestInterceptor implements RequestInterceptor {
|
89
|
-
|
90
|
-
private final OAuth2AuthorizedClientManager oAuth2AuthorizedClientManager;
|
91
|
-
private final OAuth2AuthorizeRequest oAuth2AuthorizeRequest;
|
92
|
-
|
93
|
-
public OAuth2RequestInterceptor(OAuth2AuthorizeRequest oAuth2AuthorizeRequest,OAuth2AuthorizedClientManager oAuth2AuthorizedClientManager){
|
94
|
-
this.oAuth2AuthorizeRequest = oAuth2AuthorizeRequest;
|
95
|
-
this.oAuth2AuthorizedClientManager = oAuth2AuthorizedClientManager;
|
96
|
-
}
|
97
|
-
|
98
|
-
@Override
|
99
|
-
public void apply( final RequestTemplate template ) {
|
100
|
-
template.header( HttpHeaders.AUTHORIZATION, getBearerToken() );
|
101
|
-
}
|
102
|
-
|
103
|
-
public OAuth2AccessToken getAccessToken() {
|
104
|
-
final OAuth2AuthorizedClient authorizedClient = oAuth2AuthorizedClientManager.authorize(oAuth2AuthorizeRequest);
|
105
|
-
if (authorizedClient == null) {
|
106
|
-
throw new OAuth2AuthenticationException( "Client failed to authenticate");
|
107
|
-
}
|
108
|
-
return authorizedClient.getAccessToken();
|
109
|
-
}
|
110
|
-
|
111
|
-
public String getBearerToken() {
|
112
|
-
final OAuth2AccessToken accessToken = getAccessToken();
|
113
|
-
return String.format( "%s %s", accessToken.getTokenType().getValue(), accessToken.getTokenValue() );
|
114
|
-
}
|
115
|
-
}
|
116
|
-
{{/hasOAuthMethods}}
|
117
|
-
|
118
|
-
}
|