Skip to content

Commit 1dde3d0

Browse files
Merge branch 'master' into nestjs-server-codegen
2 parents 71aafbe + 7af84ca commit 1dde3d0

File tree

3,090 files changed

+178709
-13275
lines changed

Some content is hidden

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

3,090 files changed

+178709
-13275
lines changed

.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
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Samples cpp oat++ server
2+
3+
on:
4+
push:
5+
branches:
6+
- "samples/server/petstore/cpp-oatpp/**"
7+
pull_request:
8+
paths:
9+
- "samples/server/petstore/cpp-oatpp/**"
10+
11+
env:
12+
GRADLE_VERSION: 6.9
13+
14+
jobs:
15+
build:
16+
name: Build cpp qt client
17+
strategy:
18+
matrix:
19+
sample:
20+
- samples/server/petstore/cpp-oatpp
21+
os:
22+
- ubuntu-latest
23+
- macOS-latest
24+
- windows-latest
25+
runs-on: ${{ matrix.os }}
26+
steps:
27+
- uses: actions/checkout@v4
28+
- name: Build
29+
working-directory: ${{ matrix.sample }}
30+
run: cmake -B build && cmake --build build --verbose
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Samples Go Clients
2+
3+
on:
4+
push:
5+
paths:
6+
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
7+
pull_request:
8+
paths:
9+
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/**'
10+
11+
jobs:
12+
build:
13+
name: Build Go
14+
runs-on: windows-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
sample:
19+
- 'samples/openapi3/client/petstore/go/go-petstore-aws-signature/'
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: actions/setup-go@v5
23+
- run: go version
24+
- name: Install Dependencies
25+
working-directory: ${{ matrix.sample }}
26+
run: |
27+
go mod tidy
28+
- name: Run test
29+
working-directory: ${{ matrix.sample }}
30+
run: go test -mod=mod -v
31+

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
- samples/client/petstore/java/microprofile-rest-client-mutiny
7272
- samples/client/petstore/java/microprofile-rest-client-3.0
7373
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson
74+
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson-mutiny
7475
- samples/client/petstore/java/microprofile-rest-client-3.0-jackson-with-xml
7576
- samples/client/petstore/java/microprofile-rest-client-3.0-mutiny
7677
- samples/client/petstore/java/microprofile-rest-client-with-useSingleRequestParameter
@@ -133,4 +134,4 @@ jobs:
133134
- name: Build with Gradle
134135
working-directory: ${{ matrix.sample }}
135136
if: ${{ hashFiles('./gradlew') != '' }}
136-
run: ./gradlew build -x test
137+
run: ./gradlew build -x test

.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

.github/workflows/samples-rust.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,54 @@ jobs:
2626
- samples/client/others/rust/
2727
- samples/client/petstore/rust/
2828
- samples/server/petstore/rust-server/
29+
- samples/server/petstore/rust-server-deprecated/
2930
- samples/server/petstore/rust-axum/
3031
steps:
3132
- uses: actions/checkout@v4
3233
- uses: actions-rs/toolchain@v1
3334
with:
3435
toolchain: stable
36+
37+
- name: Rust cache
38+
uses: Swatinem/rust-cache@v2
39+
with:
40+
cache-targets: false # Don't cache workspace target directories as they don't exist
41+
cache-directories:
42+
${{ matrix.sample }}/target
43+
workspaces: |
44+
${{ matrix.sample }}/output/*
45+
3546
- name: Build
3647
working-directory: ${{ matrix.sample }}
3748
run: cargo build --all-targets --all-features
49+
- name: Tests
50+
working-directory: ${{ matrix.sample }}
51+
run: |
52+
set -e
53+
# Skip samples/client/petstore/rust/ as it's tests are failing.
54+
if [[ "${{ matrix.sample }}" == "samples/client/petstore/rust/" ]]; then
55+
echo "Skipping tests for samples/client/petstore/rust/"
56+
exit 0
57+
fi
58+
59+
# Iterate through each example and test various features
60+
for package in $(find . -maxdepth 1 -mindepth 1 -type d)
61+
do
62+
# Not all versions have a client example
63+
if test -f examples/client/main.rs; then
64+
cargo build --example client --features="client"
65+
fi
66+
# Not all versions have a server example
67+
if test -f examples/server/main.rs; then
68+
cargo build --example server --features="server"
69+
fi
70+
# Test the CLI works if present
71+
if test -f bin/cli.rs; then
72+
cargo build --bin ${package##*/} --features cli
73+
target/debug/${package##*/} --help
74+
fi
75+
cargo fmt
76+
cargo test
77+
cargo clippy
78+
cargo doc
79+
done

.github/workflows/samples-spring-jdk17.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- samples/server/petstore/springboot-lombok-tostring
1111
- samples/server/petstore/springboot-file-delegate-optional
1212
- samples/server/petstore/springboot-petstore-with-api-response-examples
13+
- samples/server/petstore/spring-boot-oneof-sealed
1314
pull_request:
1415
paths:
1516
- samples/openapi3/client/petstore/spring-cloud-3-with-optional
@@ -19,6 +20,7 @@ on:
1920
- samples/server/petstore/springboot-lombok-tostring
2021
- samples/server/petstore/springboot-file-delegate-optional
2122
- samples/server/petstore/springboot-petstore-with-api-response-examples
23+
- samples/server/petstore/spring-boot-oneof-sealed
2224
jobs:
2325
build:
2426
name: Build Java Spring (JDK17)
@@ -36,6 +38,7 @@ jobs:
3638
- samples/server/petstore/springboot-lombok-tostring
3739
- samples/server/petstore/springboot-file-delegate-optional
3840
- samples/server/petstore/springboot-petstore-with-api-response-examples
41+
- samples/server/petstore/spring-boot-oneof-sealed
3942
steps:
4043
- uses: actions/checkout@v4
4144
- uses: actions/setup-java@v4

0 commit comments

Comments
 (0)