Skip to content

Commit ebe7f5e

Browse files
committed
merge master
2 parents be1a195 + 2f70572 commit ebe7f5e

718 files changed

Lines changed: 67759 additions & 2510 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@
1818
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example `./bin/generate-samples.sh bin/configs/java*`.
1919
IMPORTANT: Do **NOT** purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
2020
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master` (upcoming `7.x.0` minor release - breaking changes with fallbacks), `8.0.x` (breaking changes without fallbacks)
21+
- [ ] If your PR solves a reported issue, reference it using [GitHub's linking syntax](https://docs.github.com/en/issues/tracking-your-work-with-issues/using-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) (e.g., having `"fixes #123"` present in the PR description)
2122
- [ ] If your PR is targeting a particular programming language, @mention the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) members, so they are more likely to review the pull request.

.github/workflows/openapi-generator.yaml

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -142,37 +142,19 @@ jobs:
142142
path: modules/openapi-generator-cli/target
143143
- name: Delete samples that are entirely generated
144144
run: |
145-
rm -rf samples/client/petstore/csharp/generichost/latest/HelloWorld
146-
rm -rf samples/client/petstore/csharp/generichost/latest/Tags
147-
rm -rf samples/client/petstore/csharp/generichost/latest/OneOfList
148-
149-
rm -rf samples/client/petstore/csharp/generichost/net8/AllOf
150-
rm -rf samples/client/petstore/csharp/generichost/net8/AnyOf
151-
rm -rf samples/client/petstore/csharp/generichost/net8/AnyOfNoCompare
152-
rm -rf samples/client/petstore/csharp/generichost/net8/FormModels
153-
rm -rf samples/client/petstore/csharp/generichost/net8/NullReferenceTypes
154-
rm -rf samples/client/petstore/csharp/generichost/net8/OneOf
155-
rm -rf samples/client/petstore/csharp/generichost/net8/Petstore
156-
rm -rf samples/client/petstore/csharp/generichost/net8/SourceGeneration
157-
rm -rf samples/client/petstore/csharp/generichost/net8/UseDateTimeForDate
158-
159-
rm -rf samples/client/petstore/csharp/generichost/standard2.0/Petstore
160-
161-
rm -rf samples/client/petstore/csharp/generichost/net4.8/AllOf
162-
rm -rf samples/client/petstore/csharp/generichost/net4.8/AnyOf
163-
rm -rf samples/client/petstore/csharp/generichost/net4.8/AnyOfNoCompare
164-
rm -rf samples/client/petstore/csharp/generichost/net4.8/FormModels
165-
rm -rf samples/client/petstore/csharp/generichost/net4.8/OneOf
166-
rm -rf samples/client/petstore/csharp/generichost/net4.8/Petstore
167-
rm -rf samples/client/petstore/csharp/generichost/net4.8/UseDateTimeForDate
168-
169-
rm -rf samples/client/petstore/csharp/generichost/net4.7/AllOf
170-
rm -rf samples/client/petstore/csharp/generichost/net4.7/AnyOf
171-
rm -rf samples/client/petstore/csharp/generichost/net4.7/AnyOfNoCompare
172-
rm -rf samples/client/petstore/csharp/generichost/net4.7/FormModels
173-
rm -rf samples/client/petstore/csharp/generichost/net4.7/OneOf
174-
rm -rf samples/client/petstore/csharp/generichost/net4.7/Petstore
175-
rm -rf samples/client/petstore/csharp/generichost/net4.7/UseDateTimeForDate
145+
# List all directories in generichost, filter out Manual directories, and remove the rest
146+
cd samples/client/petstore/csharp/generichost
147+
for version_dir in */ ; do
148+
if [ -d "$version_dir" ]; then
149+
cd "$version_dir"
150+
for dir in */ ; do
151+
if [ -d "$dir" ] && [[ ! "$dir" =~ Manual ]]; then
152+
rm -rf "$dir"
153+
fi
154+
done
155+
cd ..
156+
fi
157+
done
176158
- name: Generate samples
177159
run: |
178160
bash bin/generate-samples.sh

.github/workflows/samples-java-client-jdk17.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ on:
66
- samples/client/petstore/java/resttemplate-jakarta/**
77
- samples/client/petstore/java/webclient-jakarta/**
88
- samples/client/petstore/java/restclient-*/**
9+
- samples/client/others/java/webclient-sealedInterface/**
910
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
1011
- samples/client/others/java/restclient-enum-in-multipart/**
1112
pull_request:
1213
paths:
1314
- samples/client/petstore/java/resttemplate-jakarta/**
1415
- samples/client/petstore/java/webclient-jakarta/**
1516
- samples/client/petstore/java/restclient-*/**
17+
- samples/client/others/java/webclient-sealedInterface/**
1618
- samples/client/petstore/java/webclient-useSingleRequestParameter/**
1719
- samples/client/others/java/restclient-enum-in-multipart/**
1820
jobs:
@@ -31,6 +33,7 @@ jobs:
3133
- samples/client/petstore/java/restclient-swagger2
3234
- samples/client/petstore/java/restclient-useSingleRequestParameter
3335
- samples/client/petstore/java/restclient-useSingleRequestParameter-static
36+
- samples/client/others/java/webclient-sealedInterface
3437
- samples/client/petstore/java/webclient-useSingleRequestParameter
3538
- samples/client/others/java/restclient-enum-in-multipart
3639
steps:
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Samples PHP clients
2+
3+
on:
4+
push:
5+
paths:
6+
- samples/client/petstore/php/OpenAPIClient-php/**
7+
pull_request:
8+
paths:
9+
- samples/client/petstore/php/OpenAPIClient-php/**
10+
jobs:
11+
build:
12+
name: Build PHP projects
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
php:
18+
- "8.1"
19+
- "8.2"
20+
- "8.3"
21+
- "8.4"
22+
sample:
23+
# clients
24+
- samples/client/petstore/php/OpenAPIClient-php/
25+
services:
26+
petstore-api:
27+
image: swaggerapi/petstore
28+
ports:
29+
- 80:8080
30+
env:
31+
SWAGGER_HOST: http://petstore.swagger.io
32+
SWAGGER_BASE_PATH: /v2
33+
steps:
34+
- uses: actions/checkout@v4
35+
- name: Setup PHP with tools
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: "${{ matrix.php }}"
39+
tools: php-cs-fixer, phpunit
40+
- name: composer install
41+
working-directory: ${{ matrix.sample }}
42+
run: composer install
43+
- name: phpunit
44+
working-directory: ${{ matrix.sample }}
45+
run: vendor/bin/phpunit tests
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
generatorName: cpp-oatpp-server
22
outputDir: samples/server/petstore/cpp-oatpp
3-
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/cpp-oatpp-server/petstore.yaml
44
templateDir: modules/openapi-generator/src/main/resources/cpp-oatpp-server
55
additionalProperties:
66
addExternalLibs: "true"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
generatorName: java
2+
outputDir: samples/client/others/java/webclient-sealedInterface
3+
library: webclient
4+
inputSpec: modules/openapi-generator/src/test/resources/3_0/oneof_polymorphism_and_inheritance.yaml
5+
templateDir: modules/openapi-generator/src/main/resources/Java
6+
additionalProperties:
7+
artifactId: sealed-interface-webclient
8+
hideGenerationTimestamp: "true"
9+
useOneOfInterfaces: true
10+
useSealedOneOfInterfaces: true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
generatorName: rust-axum
2+
outputDir: samples/server/petstore/rust-axum/output/apikey-authorization
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/jetbrains/CheckoutBasicBearerCookieQueryHeaderBasicBearer.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/rust-axum
5+
generateAliasAsModel: true
6+
additionalProperties:
7+
hideGenerationTimestamp: "true"
8+
packageName: apikey-authorization
9+
basicAuthorization: true
10+
basicAnalytic: true
11+
ownedRequest: true
12+
globalProperties:
13+
skipFormModel: false
14+
enablePostProcessFile: true

docs/generators/java-microprofile.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
103103
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
104104
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
105105
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
106+
|useSealedOneOfInterfaces|Generate the oneOf interfaces as sealed interfaces. Only supported for WebClient and RestClient.| |false|
106107
|useSingleRequestParameter|Setting this property to "true" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY native, jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static with single parameter instantiation.| |false|
107108
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
108109
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|

docs/generators/java.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
103103
|useRuntimeException|Use RuntimeException instead of Exception. Only jersey2, jersey3, okhttp-gson, vertx, microprofile support this option.| |false|
104104
|useRxJava2|Whether to use the RxJava2 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
105105
|useRxJava3|Whether to use the RxJava3 adapter with the retrofit2 library. IMPORTANT: This option has been deprecated.| |false|
106+
|useSealedOneOfInterfaces|Generate the oneOf interfaces as sealed interfaces. Only supported for WebClient and RestClient.| |false|
106107
|useSingleRequestParameter|Setting this property to "true" will generate functions with a single argument containing all API endpoint parameters instead of one argument per parameter. ONLY native, jersey2, jersey3, okhttp-gson, microprofile, Spring RestClient, Spring WebClient support this option. Setting this property to "static" does the same as "true", but also makes the generated arguments class static with single parameter instantiation.| |false|
107108
|webclientBlockingOperations|Making all WebClient operations blocking(sync). Note that if on operation 'x-webclient-blocking: false' then such operation won't be sync| |false|
108109
|withAWSV4Signature|whether to include AWS v4 signature support (only available for okhttp-gson library)| |false|

modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ class OpenApiGeneratorPlugin : Plugin<Project> {
8585

8686
inputSpec.set(validate.inputSpec)
8787
recommend.set(validate.recommend)
88+
treatWarningsAsErrors.set(validate.treatWarningsAsErrors)
8889
}
8990

9091
register("openApiGenerate", GenerateTask::class.java).configure {

0 commit comments

Comments
 (0)