@team-supercharge/oasg 18.2.1 → 18.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/bin/oasg +5 -6
- package/package.json +12 -3
- package/targets/dotnet-webapi-system-text-json/README.md +5 -5
- package/targets/dotnet-webapi-system-text-json/templates/minimalEndpoints.mustache +1 -1
- package/targets/feign/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/targets/feign/.mvn/wrapper/maven-wrapper.properties +4 -2
- package/targets/feign/generate.sh +14 -1
- package/targets/feign/generator-config.json +2 -9
- package/targets/feign/mvnw +196 -168
- package/targets/feign-kotlin/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/targets/feign-kotlin/.mvn/wrapper/maven-wrapper.properties +4 -2
- package/targets/feign-kotlin/generate.sh +15 -1
- package/targets/feign-kotlin/generator-config.json +2 -7
- package/targets/feign-kotlin/mvnw +196 -168
- package/targets/feign-kotlin/templates/libraries/spring-cloud/pom-sb3.mustache +248 -0
- package/targets/plain-java/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/targets/plain-java/.mvn/wrapper/maven-wrapper.properties +4 -2
- package/targets/plain-java/generate.sh +13 -1
- package/targets/plain-java/generator-config.json +3 -5
- package/targets/plain-java/mvnw +196 -168
- package/targets/spring/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/targets/spring/.mvn/wrapper/maven-wrapper.properties +4 -2
- package/targets/spring/generate.sh +13 -1
- package/targets/spring/generator-config.json +2 -7
- package/targets/spring/mvnw +196 -168
- package/targets/spring-kotlin/.mvn/wrapper/maven-wrapper.jar +0 -0
- package/targets/spring-kotlin/.mvn/wrapper/maven-wrapper.properties +4 -2
- package/targets/spring-kotlin/generate.sh +13 -1
- package/targets/spring-kotlin/generator-config.json +2 -5
- package/targets/spring-kotlin/mvnw +196 -168
- package/targets/feign/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
- package/targets/feign/templates/beanValidation.mustache +0 -2
- package/targets/feign/templates/formParams.mustache +0 -3
- package/targets/feign-kotlin/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
- package/targets/plain-java/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
- package/targets/spring/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
- package/targets/spring-kotlin/.mvn/wrapper/MavenWrapperDownloader.java +0 -117
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.
|
|
42
|
-
"feign-kotlin": { version: '7.
|
|
43
|
-
"plain-java": { version: '7.
|
|
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.
|
|
56
|
-
"spring-kotlin": { version: '7.
|
|
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.
|
|
3
|
+
"version": "18.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",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"express": "^4.18.2",
|
|
37
37
|
"express-http-proxy": "^1.6.3",
|
|
38
38
|
"glob": "^10.2.1",
|
|
39
|
-
"js-yaml": "^4.
|
|
39
|
+
"js-yaml": "^4.3.0",
|
|
40
40
|
"json-schema-merge-allof": "^0.8.1",
|
|
41
|
-
"openapi-to-postmanv2": "
|
|
41
|
+
"openapi-to-postmanv2": "6.3.0",
|
|
42
42
|
"openapi-typescript-validator-ext-ref": "^3.2.0-external-ref-support",
|
|
43
43
|
"swagger-ui-express": "^5.0.1",
|
|
44
44
|
"yamljs": "^0.3.0",
|
|
@@ -51,5 +51,14 @@
|
|
|
51
51
|
"jest": "^29.5.0",
|
|
52
52
|
"jest-html-reporter": "^4.4.0",
|
|
53
53
|
"jest-junit": "^17.0.0"
|
|
54
|
+
},
|
|
55
|
+
"overrides": {
|
|
56
|
+
"lodash": "^4.18.1",
|
|
57
|
+
"@redocly/respect-core": {
|
|
58
|
+
"js-yaml": "4.3.0"
|
|
59
|
+
},
|
|
60
|
+
"openapi-to-postmanv2": {
|
|
61
|
+
"js-yaml": "4.3.0"
|
|
62
|
+
}
|
|
54
63
|
}
|
|
55
64
|
}
|
|
@@ -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.
|
|
128
|
+
=> Task.FromResult(request.Pet);
|
|
129
129
|
|
|
130
130
|
public async Task<Pet> Handle(GetPetByIdRequest request)
|
|
131
|
-
=> await _repository.GetAsync(request.
|
|
132
|
-
?? throw new PetNotFoundException(request.
|
|
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.
|
|
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.
|
|
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}}
|
|
Binary file
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 "
|
|
26
|
+
-p "$props" \
|
|
27
|
+
$generatorCustomArgs
|
|
15
28
|
|
|
16
29
|
cd out/$targetId
|
|
17
30
|
cp $(dirname "$0")/mvnw .
|
|
@@ -1,22 +1,15 @@
|
|
|
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,
|
|
13
8
|
"typeMappings": {
|
|
14
|
-
"OffsetDateTime": "
|
|
15
|
-
"Date": "java.time.LocalDate"
|
|
9
|
+
"OffsetDateTime": "Instant"
|
|
16
10
|
},
|
|
17
11
|
"importMappings": {
|
|
18
|
-
"
|
|
19
|
-
"java.util.Date": "java.time.LocalDate"
|
|
12
|
+
"OffsetDateTime": "java.time.Instant"
|
|
20
13
|
},
|
|
21
14
|
"inlineSchemaOptions": {
|
|
22
15
|
"ARRAY_ITEM_SUFFIX": "",
|