@team-supercharge/oasg 18.2.2 → 18.3.1-temp-feat-jvm-breaking.c418dc3b

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.
Files changed (38) hide show
  1. package/README.md +77 -36
  2. package/bin/oasg +5 -6
  3. package/package.json +1 -1
  4. package/targets/dotnet-webapi-system-text-json/README.md +5 -5
  5. package/targets/dotnet-webapi-system-text-json/templates/minimalEndpoints.mustache +1 -1
  6. package/targets/feign/.mvn/wrapper/maven-wrapper.jar +0 -0
  7. package/targets/feign/.mvn/wrapper/maven-wrapper.properties +4 -2
  8. package/targets/feign/generate.sh +14 -1
  9. package/targets/feign/generator-config.json +7 -9
  10. package/targets/feign/mvnw +196 -168
  11. package/targets/feign-kotlin/.mvn/wrapper/maven-wrapper.jar +0 -0
  12. package/targets/feign-kotlin/.mvn/wrapper/maven-wrapper.properties +4 -2
  13. package/targets/feign-kotlin/generate.sh +15 -1
  14. package/targets/feign-kotlin/generator-config.json +6 -8
  15. package/targets/feign-kotlin/mvnw +196 -168
  16. package/targets/feign-kotlin/templates/libraries/spring-cloud/pom-sb4.mustache +241 -0
  17. package/targets/plain-java/.mvn/wrapper/maven-wrapper.jar +0 -0
  18. package/targets/plain-java/.mvn/wrapper/maven-wrapper.properties +4 -2
  19. package/targets/plain-java/generate.sh +13 -1
  20. package/targets/plain-java/generator-config.json +3 -5
  21. package/targets/plain-java/mvnw +196 -168
  22. package/targets/spring/.mvn/wrapper/maven-wrapper.jar +0 -0
  23. package/targets/spring/.mvn/wrapper/maven-wrapper.properties +4 -2
  24. package/targets/spring/generate.sh +13 -1
  25. package/targets/spring/generator-config.json +6 -7
  26. package/targets/spring/mvnw +196 -168
  27. package/targets/spring-kotlin/.mvn/wrapper/maven-wrapper.jar +0 -0
  28. package/targets/spring-kotlin/.mvn/wrapper/maven-wrapper.properties +4 -2
  29. package/targets/spring-kotlin/generate.sh +13 -1
  30. package/targets/spring-kotlin/generator-config.json +6 -6
  31. package/targets/spring-kotlin/mvnw +196 -168
  32. package/targets/feign/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
  33. package/targets/feign/templates/beanValidation.mustache +0 -2
  34. package/targets/feign/templates/formParams.mustache +0 -3
  35. package/targets/feign-kotlin/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
  36. package/targets/plain-java/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
  37. package/targets/spring/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
  38. package/targets/spring-kotlin/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
package/README.md CHANGED
@@ -128,42 +128,42 @@ include:
128
128
 
129
129
  The table below gives an overview of the changes (breaking, non-breaking, bug fixes) introduced in various major versions. For the resolution of breaking changes please consult the [Migration Guide](#migration-guide).
130
130
 
131
- | Component | | | | | | | | | | | | | | | | | | |
132
- |----------------------------------|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
133
- | **Internal** | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
134
- | _Core_ |✨ |💥 |✨ |🐛 |💥 |✨ |🐛 |✨ |➖ |✨ |🐛 |🐛 |➖ |💥 |💥 |✨ |💥 |🆕 |
135
- | _Linter_ |➖ |➖ |🐛 |➖ |➖ |➖ |➖ |💥 |➖ |➖ |➖ |➖ |🐛 |➖ |✨ |💥 |🆕 |
136
- | **Client Targets** | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
137
- | `android` |✨ |➖ |➖ |➖ |🐛 |💥 |➖ |➖ |💥 |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
138
- | `angular` |➖ |➖ |✨ |➖ |🐛 |💥 |➖ |➖ |➖ |🐛 |➖ |➖ |➖ |💥 |➖ |➖ |➖ |🆕 |
139
- | `dotnet` |✨ |➖ |➖ |➖ |🆕 |
140
- | `dotnet-system-text-json` |🆕➖|
141
- | `dotnet-webapi` |✨ |➖ |🆕➖|
142
- | `dotnet-webapi-system-text-json` |🆕➖|
143
- | `feign` |🐛 |🐛 |✨ |➖ |➖ |➖ |➖ |➖ |✨ |💥 |💥 |➖ |➖ |🐛 |🐛 |🆕 |
144
- | `feign-kotlin` |🐛 |🐛 |✨ |➖ |➖ |➖ |➖ |➖ |🆕 |
145
- | `plain-java` |🐛 |🐛 |🆕 |
146
- | `flutter` |➖ |➖ |➖ |➖ |➖ |🆕 |
147
- | `ios` |➖ |➖ |➖ |➖ |➖ |💥 |🐛 |➖ |➖ |➖ |✨ |➖ |💥 |➖ |➖ |✨ |🆕 |
148
- | `apple-swift` |➖ |➖ |🆕 |
149
- | `kmp` |✨ |✨ |➖ |➖ |🆕 |
150
- | `python` |🐛 |➖ |🆕 |
151
- | `python-legacy` |🐛 |➖ |💥 |➖ |🐛 |💥 |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
152
- | `react` |💥 |➖ |🐛 |🐛 |➖ |💥 |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
153
- | `typescript-axios` |✨ |➖ |🆕 |
154
- | `typescript-fetch` |✨ |➖ |🆕 |
155
- | **Server Targets** | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
156
- | `nestjs` |✨ |🐛 |💥 |💥 |➖ |💥 |✨ |➖ |➖ |🐛 |➖ |➖ |✨ |🆕 |
157
- | `python-fastapi` |➖ |➖ |➖ |➖ |🆕 |
158
- | `python-fastapi-raw-request` |➖ |➖ |➖ |➖ |🆕 |
159
- | `spring` |🐛 |🐛 |✨ |➖ |➖ |➖ |➖ |➖ |✨ |💥 |💥 |➖ |➖ |➖ |✨ |➖ |🆕 |
160
- | `spring-kotlin` |🐛 |✨ |✨ |➖ |➖ |➖ |➖ |➖ |✨ |💥 |💥 |➖ |➖ |🐛 |✨ |➖ |🆕 |
161
- | **Misc Targets** | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
162
- | `contract-testing` |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
163
- | `openapi` |➖ |➖ |➖ |➖ |➖ |➖ |💥 |➖ |➖ |✨ |➖ |🆕 |
164
- | `stubby` |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |💥 |➖ |➖ |➖ |➖ |🆕 |
165
- | `postman` |➖ |➖ |➖ |🆕 |
166
- | `msw` |🆕 |
131
+ | Component | | | | | | | | | | | | | | | | | | | |
132
+ |----------------------------------|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
133
+ | **Internal** | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
134
+ | _Core_ |➖ |✨ |💥 |✨ |🐛 |💥 |✨ |🐛 |✨ |➖ |✨ |🐛 |🐛 |➖ |💥 |💥 |✨ |💥 |🆕 |
135
+ | _Linter_ |➖ |➖ |➖ |🐛 |➖ |➖ |➖ |➖ |💥 |➖ |➖ |➖ |➖ |🐛 |➖ |✨ |💥 |🆕 |
136
+ | **Client Targets** | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
137
+ | `android` |➖ |✨ |➖ |➖ |➖ |🐛 |💥 |➖ |➖ |💥 |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
138
+ | `angular` |➖ |➖ |➖ |✨ |➖ |🐛 |💥 |➖ |➖ |➖ |🐛 |➖ |➖ |➖ |💥 |➖ |➖ |➖ |🆕 |
139
+ | `dotnet` |➖ |✨ |➖ |➖ |➖ |🆕 |
140
+ | `dotnet-system-text-json` |➖ |🆕➖|
141
+ | `dotnet-webapi` |➖ |✨ |➖ |🆕➖|
142
+ | `dotnet-webapi-system-text-json` |➖ |🆕➖|
143
+ | `feign` |💥 |🐛 |🐛 |✨ |➖ |➖ |➖ |➖ |➖ |✨ |💥 |💥 |➖ |➖ |🐛 |🐛 |🆕 |
144
+ | `feign-kotlin` |💥 |🐛 |🐛 |✨ |➖ |➖ |➖ |➖ |➖ |🆕 |
145
+ | `plain-java` |➖ |🐛 |🐛 |🆕 |
146
+ | `flutter` |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
147
+ | `ios` |➖ |➖ |➖ |➖ |➖ |➖ |💥 |🐛 |➖ |➖ |➖ |✨ |➖ |💥 |➖ |➖ |✨ |🆕 |
148
+ | `apple-swift` |➖ |➖ |➖ |🆕 |
149
+ | `kmp` |➖ |✨ |✨ |➖ |➖ |🆕 |
150
+ | `python` |➖ |🐛 |➖ |🆕 |
151
+ | `python-legacy` |➖ |🐛 |➖ |💥 |➖ |🐛 |💥 |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
152
+ | `react` |➖ |💥 |➖ |🐛 |🐛 |➖ |💥 |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
153
+ | `typescript-axios` |➖ |✨ |➖ |🆕 |
154
+ | `typescript-fetch` |➖ |✨ |➖ |🆕 |
155
+ | **Server Targets** | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
156
+ | `nestjs` |➖ |✨ |🐛 |💥 |💥 |➖ |💥 |✨ |➖ |➖ |🐛 |➖ |➖ |✨ |🆕 |
157
+ | `python-fastapi` |➖ |➖ |➖ |➖ |➖ |🆕 |
158
+ | `python-fastapi-raw-request` |➖ |➖ |➖ |➖ |➖ |🆕 |
159
+ | `spring` |💥 |🐛 |🐛 |✨ |➖ |➖ |➖ |➖ |➖ |✨ |💥 |💥 |➖ |➖ |➖ |✨ |➖ |🆕 |
160
+ | `spring-kotlin` |💥 |🐛 |✨ |✨ |➖ |➖ |➖ |➖ |➖ |✨ |💥 |💥 |➖ |➖ |🐛 |✨ |➖ |🆕 |
161
+ | **Misc Targets** | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 |
162
+ | `contract-testing` |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |🆕 |
163
+ | `openapi` |➖ |➖ |➖ |➖ |➖ |➖ |➖ |💥 |➖ |➖ |✨ |➖ |🆕 |
164
+ | `stubby` |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |➖ |💥 |➖ |➖ |➖ |➖ |🆕 |
165
+ | `postman` |➖ |➖ |➖ |➖ |🆕 |
166
+ | `msw` |➖ |🆕 |
167
167
 
168
168
  **Legend:**
169
169
 
@@ -1519,6 +1519,47 @@ setupWorker(
1519
1519
 
1520
1520
  This section covers the breaking changes and their migrations across major version upgrades.
1521
1521
 
1522
+ ## From `18.x.x` to `19.0.0`
1523
+
1524
+ ### Breaking in `spring`, `spring-kotlin`, `feign` and `feign-kotlin` targets
1525
+
1526
+ SDK jars produced by these targets now target **Spring Boot 4** and **Jackson 3**, which moved to
1527
+ the new `tools.jackson` group. Consumers must upgrade accordingly, or pin the previous baseline via
1528
+ `generatorCustomArgs` in their _OASg_ `config.json`:
1529
+
1530
+ ```json
1531
+ "generatorCustomArgs": "-puseSpringBoot3=true -puseSpringBoot4=false -puseJackson3=false -popenApiNullable=true"
1532
+ ```
1533
+
1534
+ ### Breaking in `spring` and `feign` targets
1535
+
1536
+ `openApiNullable` is now disabled, as the `jackson-databind-nullable` library behind it is Jackson 2
1537
+ only. `nullable: true` properties are generated as plain types instead of `JsonNullable<T>`.
1538
+
1539
+ ### Breaking in `spring-kotlin` and `feign-kotlin` targets
1540
+
1541
+ API interface methods have no default implementation anymore and fail compilation unless the consumer
1542
+ overrides them. To keep the previous behaviour, set `skipDefaultInterface=false` back via
1543
+ `generatorCustomArgs` in your _OASg_ `config.json`.
1544
+
1545
+ ## From `18.2.x` to `18.3.0`
1546
+
1547
+ These changes shipped in `18.3.0` with the update to _OpenAPI Generator_ `7.22.0`.
1548
+
1549
+ ### Breaking in `spring-kotlin` and `feign-kotlin` targets
1550
+
1551
+ 1. `oneOf` schemas with a `discriminator` are now generated as a Kotlin `sealed interface` declaring
1552
+ only the discriminator property, so subtype properties have to be reached by narrowing with `is`.
1553
+ 2. Projects overriding `model.mustache` via `templateDir` must re-fork it — it changed significantly
1554
+ upstream. See [Template Customization](#template-customization).
1555
+
1556
+ ### Breaking in `feign` and `feign-kotlin` targets
1557
+
1558
+ The generated client configuration classes (`ClientConfiguration`, `ApiKeyRequestInterceptor`, and
1559
+ `ClientPropertiesConfiguration` for OAuth specs) moved from the shared
1560
+ `org.openapitools.configuration` package to `<basePackage>.config`, so clients no longer overshadow
1561
+ each other in projects consuming several of them. Update your imports accordingly.
1562
+
1522
1563
  ## From `17.x.x` to `18.0.0`
1523
1564
 
1524
1565
  ### Breaking in `react` target
package/bin/oasg CHANGED
@@ -38,9 +38,9 @@ const DEFAULT_GENERATOR_MAPPING = {
38
38
  // client targets
39
39
  "android": { version: '7.17.0', generator: 'kotlin' },
40
40
  "angular": { version: '7.11.0', generator: 'typescript-angular' },
41
- "feign": { version: '7.12.0', generator: 'spring' },
42
- "feign-kotlin": { version: '7.12.0', generator: 'kotlin-spring' },
43
- "plain-java": { version: '7.12.0', generator: 'java' },
41
+ "feign": { version: '7.22.0', generator: 'spring' },
42
+ "feign-kotlin": { version: '7.22.0', generator: 'kotlin-spring' },
43
+ "plain-java": { version: '7.22.0', generator: 'java' },
44
44
  "flutter": { version: '7.0.1', generator: 'dart-dio' },
45
45
  "ios": { version: '7.0.1', generator: 'swift5' },
46
46
  "apple-swift": { version: undefined, generator: undefined },
@@ -52,8 +52,8 @@ const DEFAULT_GENERATOR_MAPPING = {
52
52
  "typescript-fetch": { version: '7.11.0', generator: 'typescript-fetch' },
53
53
  // server targets
54
54
  "nestjs": { version: '7.0.1', generator: 'typescript-angular' },
55
- "spring": { version: '7.12.0', generator: 'spring' },
56
- "spring-kotlin": { version: '7.12.0', generator: 'kotlin-spring' },
55
+ "spring": { version: '7.22.0', generator: 'spring' },
56
+ "spring-kotlin": { version: '7.22.0', generator: 'kotlin-spring' },
57
57
  "python-fastapi": { version: '7.8.0', generator: 'python-fastapi' },
58
58
  "python-fastapi-raw-request": { version: '7.0.1', generator: 'python-fastapi' },
59
59
  "dotnet": { version: '7.11.0', generator: 'csharp-functions' },
@@ -741,4 +741,3 @@ function determineArtifactVersion(argv) {
741
741
  function determinePreRelease(argv) {
742
742
  return argv.preRelease ? true : false;
743
743
  }
744
-
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@team-supercharge/oasg",
3
- "version": "18.2.2",
3
+ "version": "18.3.1-temp-feat-jvm-breaking.c418dc3b",
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",
@@ -125,15 +125,15 @@ public class PetHandlers
125
125
  {
126
126
  // Operation with a response body -> return the response model
127
127
  public Task<Pet> Handle(AddPetRequest request)
128
- => Task.FromResult(request.pet);
128
+ => Task.FromResult(request.Pet);
129
129
 
130
130
  public async Task<Pet> Handle(GetPetByIdRequest request)
131
- => await _repository.GetAsync(request.petId)
132
- ?? throw new PetNotFoundException(request.petId);
131
+ => await _repository.GetAsync(request.PetId)
132
+ ?? throw new PetNotFoundException(request.PetId);
133
133
 
134
134
  // No-response-body operation -> return Task (the endpoint returns NoContent)
135
135
  public Task Handle(DeletePetRequest request)
136
- => _repository.DeleteAsync(request.petId);
136
+ => _repository.DeleteAsync(request.PetId);
137
137
  }
138
138
  ```
139
139
 
@@ -164,7 +164,7 @@ public class GetPetByIdHandler(IHttpContextAccessor http)
164
164
  {
165
165
  var user = http.HttpContext!.User; // authenticated principal
166
166
  var tenant = user.FindFirst("tenant")?.Value;
167
- return await _repository.GetAsync(request.petId, tenant);
167
+ return await _repository.GetAsync(request.PetId, tenant);
168
168
  }
169
169
  }
170
170
  ```
@@ -41,7 +41,7 @@ namespace {{packageName}}
41
41
  {{#operations}}
42
42
  {{#operation}}
43
43
  /// <summary>Wolverine request for {{classname}}.{{operationId}}, carrying every parameter.</summary>
44
- public record {{operationId}}Request({{#allParams}}{{>paramType}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}});
44
+ public record {{operationId}}Request({{#allParams}}{{>paramType}} {{#lambda.pascalcase}}{{paramName}}{{/lambda.pascalcase}}{{^-last}}, {{/-last}}{{/allParams}});
45
45
  {{/operation}}
46
46
  {{/operations}}
47
47
  {{/apis}}
@@ -1,2 +1,4 @@
1
- distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
2
- wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
1
+ wrapperVersion=3.3.4
2
+ distributionType=bin
3
+ distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.16/apache-maven-3.9.16-bin.zip
4
+ wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.4/maven-wrapper-3.3.4.jar
@@ -5,13 +5,26 @@ source $(dirname "$0")/../common.sh
5
5
  rm -rf out/$targetId
6
6
  mkdir -p out/$targetId
7
7
 
8
+ properties=(
9
+ "artifactId=${artifactId}"
10
+ "groupId=${groupId}"
11
+ "artifactVersion=${version}"
12
+ "basePackage=${basePackage}"
13
+ "apiPackage=${basePackage}.api"
14
+ "modelPackage=${basePackage}.model"
15
+ "configPackage=${basePackage}.config"
16
+ )
17
+
18
+ props=$(IFS=,; echo "${properties[*]}")
19
+
8
20
  java -jar $binary generate \
9
21
  -g $generatorId \
10
22
  -i $openApiFile \
11
23
  -t $templateDir \
12
24
  -o out/$targetId \
13
25
  -c $(dirname "$0")/generator-config.json \
14
- -p "artifactId=${artifactId},groupId=${groupId},basePackage=${basePackage},apiPackage=${basePackage}.api,modelPackage=${basePackage}.model,invokerPackage=${basePackage}.client,artifactVersion=${version}" $generatorCustomArgs
26
+ -p "$props" \
27
+ $generatorCustomArgs
15
28
 
16
29
  cd out/$targetId
17
30
  cp $(dirname "$0")/mvnw .
@@ -1,22 +1,20 @@
1
1
  {
2
2
  "library": "spring-cloud",
3
- "dateLibrary": "java8",
4
- "java8": true,
5
3
  "useTags": true,
6
4
  "hideGenerationTimestamp": true,
7
5
  "booleanGetterPrefix": "is",
8
- "generateForOpenFeign": true,
9
- "removeEnumValuePrefix": false,
10
6
  "documentationProvider": "none",
11
7
  "annotationLibrary": "none",
12
- "useSpringBoot3": true,
8
+ "useFeignClientContextId": false,
9
+ "useSpringBoot3": false,
10
+ "useSpringBoot4": true,
11
+ "useJackson3": true,
12
+ "openApiNullable": false,
13
13
  "typeMappings": {
14
- "OffsetDateTime": "java.time.Instant",
15
- "Date": "java.time.LocalDate"
14
+ "OffsetDateTime": "Instant"
16
15
  },
17
16
  "importMappings": {
18
- "java.time.OffsetDateTime": "java.time.Instant",
19
- "java.util.Date": "java.time.LocalDate"
17
+ "OffsetDateTime": "java.time.Instant"
20
18
  },
21
19
  "inlineSchemaOptions": {
22
20
  "ARRAY_ITEM_SUFFIX": "",