Skip to content

Commit baed6f1

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/publicstaticfinalStringPATH
2 parents fb4fac3 + 40b9d69 commit baed6f1

984 files changed

Lines changed: 129196 additions & 574 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/workflows/samples-jaxrs.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ jobs:
2020
- samples/server/petstore/jaxrs/jersey2-useTags
2121
- samples/server/petstore/jaxrs-jersey
2222
- samples/server/petstore/jaxrs-spec
23-
- samples/server/petstore/jaxrs-spec-interface
24-
- samples/server/petstore/jaxrs-spec-interface-response
25-
- samples/server/petstore/jaxrs-jersey
26-
- samples/server/petstore/jaxrs-spec
23+
- samples/server/petstore/jaxrs-spec-withxml
2724
- samples/server/petstore/jaxrs-spec-interface
2825
- samples/server/petstore/jaxrs-spec-interface-response
2926
- samples/server/petstore/jaxrs-datelib-j8
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: Samples TS clients
2+
3+
on:
4+
push:
5+
paths:
6+
- samples/client/others/typescript-angular/**
7+
# comment out angular released before Nov 2023
8+
#- samples/client/petstore/typescript-angular-v12-provided-in-root/**
9+
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
10+
#- samples/client/petstore/typescript-angular-v14-provided-in-root/**
11+
#- samples/client/petstore/typescript-angular-v15-provided-in-root/**
12+
- samples/client/petstore/typescript-angular-v16-provided-in-root/**
13+
- samples/client/petstore/typescript-angular-v17-provided-in-root/**
14+
- samples/client/petstore/typescript-angular-v18-provided-in-root/**
15+
- samples/client/petstore/typescript-angular-v19-provided-in-root/**
16+
- samples/client/petstore/typescript-angular-v20-provided-in-root/**
17+
- samples/openapi3/client/petstore/typescript/builds/default/**
18+
# comment out due to build failure
19+
#- samples/openapi3/client/petstore/typescript/tests/default/**
20+
- samples/openapi3/client/petstore/typescript/builds/jquery/**
21+
# comment out due to build failure
22+
#- samples/openapi3/client/petstore/typescript/tests/jquery/**
23+
- samples/openapi3/client/petstore/typescript/builds/object_params/**
24+
# comment out due to build failure
25+
#- samples/openapi3/client/petstore/typescript/tests/object_params/**
26+
#- samples/openapi3/client/petstore/typescript/builds/inversify/**
27+
#- samples/openapi3/client/petstore/typescript/tests/inversify/**
28+
#- samples/openapi3/client/petstore/typescript/tests/deno/**
29+
- samples/openapi3/client/petstore/typescript/builds/browser/**
30+
# comment out due to build failure
31+
#- samples/openapi3/client/petstore/typescript/tests/browser/**
32+
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/**
33+
- samples/client/petstore/typescript-fetch/builds/default/**
34+
- samples/client/petstore/typescript-fetch/builds/es6-target/**
35+
- samples/client/petstore/typescript-fetch/builds/with-npm-version/**
36+
- samples/client/petstore/typescript-fetch/tests/default/**
37+
# comment out due to build failure
38+
#- samples/client/petstore/typescript-node/npm/**
39+
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/**
40+
- samples/client/petstore/typescript-axios/builds/with-npm-version/**
41+
# comment out due to build failure
42+
#- samples/client/petstore/typescript-axios/tests/default/**
43+
pull_request:
44+
paths:
45+
- samples/client/others/typescript-angular/**
46+
#- samples/client/petstore/typescript-angular-v12-provided-in-root/**
47+
#- samples/client/petstore/typescript-angular-v13-provided-in-root/**
48+
#- samples/client/petstore/typescript-angular-v14-provided-in-root/**
49+
#- samples/client/petstore/typescript-angular-v15-provided-in-root/**
50+
- samples/client/petstore/typescript-angular-v16-provided-in-root/**
51+
- samples/client/petstore/typescript-angular-v17-provided-in-root/**
52+
- samples/client/petstore/typescript-angular-v18-provided-in-root/**
53+
- samples/client/petstore/typescript-angular-v19-provided-in-root/**
54+
- samples/client/petstore/typescript-angular-v20-provided-in-root/**
55+
- samples/openapi3/client/petstore/typescript/builds/default/**
56+
#- samples/openapi3/client/petstore/typescript/tests/default/**
57+
- samples/openapi3/client/petstore/typescript/builds/jquery/**
58+
#- samples/openapi3/client/petstore/typescript/tests/jquery/**
59+
- samples/openapi3/client/petstore/typescript/builds/object_params/**
60+
#- samples/openapi3/client/petstore/typescript/tests/object_params/**
61+
#- samples/openapi3/client/petstore/typescript/builds/inversify/**
62+
#- samples/openapi3/client/petstore/typescript/tests/inversify/**
63+
#- samples/openapi3/client/petstore/typescript/tests/deno/**
64+
- samples/openapi3/client/petstore/typescript/builds/browser/**
65+
#- samples/openapi3/client/petstore/typescript/tests/browser/**
66+
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/**
67+
- samples/client/petstore/typescript-fetch/builds/default/**
68+
- samples/client/petstore/typescript-fetch/builds/es6-target/**
69+
- samples/client/petstore/typescript-fetch/builds/with-npm-version/**
70+
- samples/client/petstore/typescript-fetch/tests/default/**
71+
#- samples/client/petstore/typescript-node/npm/**
72+
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/**
73+
- samples/client/petstore/typescript-axios/builds/with-npm-version/**
74+
#- samples/client/petstore/typescript-axios/tests/default/**
75+
jobs:
76+
build:
77+
name: Build projects
78+
runs-on: ubuntu-latest
79+
services:
80+
petstore-api:
81+
image: swaggerapi/petstore
82+
ports:
83+
- 80:8080
84+
env:
85+
SWAGGER_HOST: http://petstore.swagger.io
86+
SWAGGER_BASE_PATH: /v2
87+
strategy:
88+
fail-fast: false
89+
matrix:
90+
node:
91+
#- "18.x"
92+
- "20.x"
93+
sample:
94+
- samples/client/others/typescript-angular/
95+
#- samples/client/petstore/typescript-angular-v12-provided-in-root/
96+
#- samples/client/petstore/typescript-angular-v13-provided-in-root/
97+
#- samples/client/petstore/typescript-angular-v14-provided-in-root/
98+
#- samples/client/petstore/typescript-angular-v15-provided-in-root/
99+
- samples/client/petstore/typescript-angular-v16-provided-in-root/
100+
- samples/client/petstore/typescript-angular-v17-provided-in-root/
101+
- samples/client/petstore/typescript-angular-v18-provided-in-root/
102+
- samples/client/petstore/typescript-angular-v19-provided-in-root/
103+
- samples/client/petstore/typescript-angular-v20-provided-in-root/
104+
- samples/openapi3/client/petstore/typescript/builds/default/
105+
#- samples/openapi3/client/petstore/typescript/tests/default/
106+
- samples/openapi3/client/petstore/typescript/builds/jquery/
107+
#- samples/openapi3/client/petstore/typescript/tests/jquery/
108+
- samples/openapi3/client/petstore/typescript/builds/object_params/
109+
#- samples/openapi3/client/petstore/typescript/tests/object_params/
110+
#- samples/openapi3/client/petstore/typescript/builds/inversify/
111+
#- samples/openapi3/client/petstore/typescript/tests/inversify/
112+
#- samples/openapi3/client/petstore/typescript/tests/deno/
113+
- samples/openapi3/client/petstore/typescript/builds/browser/
114+
#- samples/openapi3/client/petstore/typescript/tests/browser/
115+
#- samples/openapi3/client/petstore/typescript/builds/nullable-enum/
116+
- samples/client/petstore/typescript-fetch/builds/default/
117+
- samples/client/petstore/typescript-fetch/builds/es6-target/
118+
- samples/client/petstore/typescript-fetch/builds/with-npm-version/
119+
- samples/client/petstore/typescript-fetch/tests/default/
120+
#- samples/client/petstore/typescript-node/npm/
121+
- samples/client/petstore/typescript-rxjs/builds/with-npm-version/
122+
- samples/client/petstore/typescript-axios/builds/with-npm-version/
123+
#- samples/client/petstore/typescript-axios/tests/default/
124+
steps:
125+
- uses: actions/checkout@v5
126+
- name: Add hosts to /etc/hosts
127+
run: |
128+
sudo echo "127.0.0.1 petstore.swagger.io" | sudo tee -a /etc/hosts
129+
- name: Set up JDK 17
130+
uses: actions/setup-java@v5
131+
with:
132+
java-version: '17' # Specify your desired Java version
133+
distribution: 'temurin' # Or 'adopt', 'oracle', etc.
134+
cache: maven # Cache Maven dependencies for faster builds
135+
- name: Use Node.js
136+
uses: actions/setup-node@v5
137+
with:
138+
node-version: ${{ matrix.node }}
139+
cache: 'npm' # Or 'yarn'
140+
- name: mvn integration-test
141+
working-directory: ${{ matrix.sample }}
142+
run: mvn integration-test
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Samples TS servers
2+
3+
on:
4+
push:
5+
paths:
6+
- samples/server/petstore/typescript-nestjs-server/**
7+
pull_request:
8+
paths:
9+
- samples/server/petstore/typescript-nestjs-server/**
10+
jobs:
11+
build:
12+
name: Build projects
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
node:
18+
- "18.x"
19+
- "20.x"
20+
sample:
21+
- samples/server/petstore/typescript-nestjs-server/
22+
steps:
23+
- uses: actions/checkout@v5
24+
- name: Use Node.js 20.x
25+
uses: actions/setup-node@v5
26+
with:
27+
node-version: ${{ matrix.node }}
28+
cache: 'npm' # Or 'yarn'
29+
- name: npm install
30+
working-directory: ${{ matrix.sample }}
31+
run: npm install
32+
- name: npm test
33+
working-directory: ${{ matrix.sample }}
34+
run: npm test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ nb-configuration.xml
4949
*.xml~
5050
*.t~
5151

52+
**/.angular
53+
5254
/target
5355
/generated-files
5456
test-output/

CI/circle_parallel.sh

Lines changed: 7 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,15 @@ export NODE_ENV=test
1111

1212
if [ "$NODE_INDEX" = "1" ]; then
1313
echo "Running node $NODE_INDEX ..."
14-
java -version
1514

1615
sudo apt-get -y install cpanminus
1716

18-
# install rust
19-
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
20-
source "$HOME/.cargo/env"
21-
2217
echo "Testing perl"
2318
(cd samples/client/petstore/perl && /bin/bash ./test.bash)
2419

25-
echo "Testing ruby"
26-
(cd samples/client/petstore/ruby && mvn integration-test)
27-
(cd samples/client/petstore/ruby-faraday && mvn integration-test)
28-
(cd samples/client/petstore/ruby-httpx && mvn integration-test)
29-
(cd samples/client/petstore/ruby-autoload && mvn integration-test)
30-
31-
echo "Testing rust"
32-
(cd samples/server/petstore/rust-axum && mvn integration-test)
3320

3421
elif [ "$NODE_INDEX" = "2" ]; then
35-
echo "Running node $NODE_INDEX to test Go"
36-
# install haskell
37-
#curl -sSLk https://get.haskellstack.org/ | sh
38-
#stack upgrade
39-
#stack --version
40-
41-
# install curl
42-
#sudo apt-get -y build-dep libcurl4-gnutls-dev
43-
#sudo apt-get -y install libcurl4-gnutls-dev
44-
45-
# Install golang version 1.18
46-
go version
47-
sudo mkdir /usr/local/go1.18
48-
wget -c https://dl.google.com/go/go1.18.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.18
49-
export PATH="/usr/local/go1.18/go/bin:$PATH"
50-
go version
22+
echo "Running node $NODE_INDEX to test cpp-restsdk"
5123

5224
# install cpprestsdk
5325
sudo apt-get install libcpprest-dev
@@ -62,55 +34,15 @@ elif [ "$NODE_INDEX" = "3" ]; then
6234

6335
echo "Running node $NODE_INDEX ... "
6436

65-
# Install node@stable (for angular 6)
66-
set +e
67-
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
68-
export NVM_DIR="/opt/circleci/.nvm"
69-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
70-
#nvm install stable
71-
# install v16 instead of the latest stable version
72-
nvm install 18
73-
nvm alias default 18
74-
node --version
75-
76-
# Each step uses the same `$BASH_ENV`, so need to modify it
77-
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
78-
echo "[ -s \"$NVM_DIR/nvm.sh\" ] && . \"$NVM_DIR/nvm.sh\"" >> $BASH_ENV
79-
80-
(cd samples/client/others/typescript-angular && mvn integration-test)
81-
(cd samples/client/petstore/typescript-angular-v12-provided-in-root && mvn integration-test)
82-
(cd samples/client/petstore/typescript-angular-v13-provided-in-root && mvn integration-test)
83-
(cd samples/client/petstore/typescript-angular-v14-provided-in-root && mvn integration-test)
84-
(cd samples/client/petstore/typescript-angular-v15-provided-in-root && mvn integration-test)
85-
(cd samples/client/petstore/typescript-angular-v16-provided-in-root && mvn integration-test)
86-
(cd samples/client/petstore/typescript-angular-v17-provided-in-root && mvn integration-test)
87-
(cd samples/client/petstore/typescript-angular-v18-provided-in-root && mvn integration-test)
88-
(cd samples/client/petstore/typescript-angular-v19-provided-in-root && mvn integration-test)
89-
(cd samples/openapi3/client/petstore/typescript/builds/default && mvn integration-test)
90-
(cd samples/openapi3/client/petstore/typescript/tests/default && mvn integration-test)
91-
(cd samples/openapi3/client/petstore/typescript/builds/jquery && mvn integration-test)
92-
(cd samples/openapi3/client/petstore/typescript/tests/jquery && mvn integration-test)
93-
(cd samples/openapi3/client/petstore/typescript/builds/object_params && mvn integration-test)
94-
(cd samples/openapi3/client/petstore/typescript/tests/object_params && mvn integration-test)
95-
(cd samples/openapi3/client/petstore/typescript/builds/inversify && mvn integration-test)
96-
(cd samples/openapi3/client/petstore/typescript/tests/inversify && mvn integration-test)
97-
#(cd samples/openapi3/client/petstore/typescript/tests/deno && mvn integration-test)
98-
(cd samples/openapi3/client/petstore/typescript/builds/browser && mvn integration-test)
99-
(cd samples/openapi3/client/petstore/typescript/tests/browser && mvn integration-test)
100-
(cd samples/openapi3/client/petstore/typescript/builds/nullable-enum && mvn integration-test)
101-
(cd samples/client/petstore/typescript-fetch/builds/default && mvn integration-test)
102-
(cd samples/client/petstore/typescript-fetch/builds/es6-target && mvn integration-test)
103-
(cd samples/client/petstore/typescript-fetch/builds/with-npm-version && mvn integration-test)
104-
(cd samples/client/petstore/typescript-fetch/tests/default && mvn integration-test)
105-
(cd samples/client/petstore/typescript-node/npm && mvn integration-test)
106-
(cd samples/client/petstore/typescript-rxjs/builds/with-npm-version && mvn integration-test)
107-
(cd samples/client/petstore/typescript-axios/builds/with-npm-version && mvn integration-test)
108-
(cd samples/client/petstore/typescript-axios/tests/default && mvn integration-test)
109-
(cd samples/client/petstore/typescript-axios/tests/with-complex-headers && mvn integration-test)
110-
(cd samples/server/petstore/typescript-nestjs-server && mvn integration-test)
37+
echo "Testing ruby"
38+
(cd samples/client/petstore/ruby && mvn integration-test)
39+
(cd samples/client/petstore/ruby-faraday && mvn integration-test)
40+
(cd samples/client/petstore/ruby-httpx && mvn integration-test)
41+
(cd samples/client/petstore/ruby-autoload && mvn integration-test)
11142

11243
else
11344
echo "Running node $NODE_INDEX ..."
11445
java -version
46+
./mvnw clean install
11547

11648
fi
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
generatorName: jaxrs-spec
2+
outputDir: samples/server/petstore/jaxrs-spec-withxml/
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec
5+
additionalProperties:
6+
artifactId: jaxrs-spec-withxml-petstore-server
7+
serializableModel: "true"
8+
hideGenerationTimestamp: "true"
9+
generateBuilders: "true"
10+
withXml: true
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
generatorName: typescript-angular
2+
outputDir: samples/client/petstore/typescript-angular-v19-provided-in-root/builds/default
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
5+
additionalProperties:
6+
ngVersion: 19.0.0
7+
supportsES6: true
8+
enumNameMappings:
9+
delivered: SHIPPED
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
generatorName: typescript-angular
2+
outputDir: samples/client/petstore/typescript-angular-v20-provided-in-root/builds/default
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
5+
additionalProperties:
6+
ngVersion: 20.0.0
7+
supportsES6: true
8+
enumNameMappings:
9+
delivered: SHIPPED
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
generatorName: typescript-fetch
2+
outputDir: samples/client/others/typescript-fetch/infinite-recursion-issue
3+
inputSpec: modules/openapi-generator/src/test/resources/3_0/typescript-fetch/infinite-recursion-issue.yaml
4+
templateDir: modules/openapi-generator/src/main/resources/typescript-fetch
5+
additionalProperties:
6+
enumPropertyNaming: "original"
7+
enumUnknownDefaultCase: true

modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,20 @@ protected void normalizeProperties(Map<String, Schema> properties, Set<Schema> v
855855
}
856856
for (Map.Entry<String, Schema> propertiesEntry : properties.entrySet()) {
857857
Schema property = propertiesEntry.getValue();
858+
859+
// remove x-internal if needed (same logic as normalizeComponentsSchemas)
860+
if (property.getExtensions() != null && getRule(REMOVE_X_INTERNAL)) {
861+
Object xInternalValue = property.getExtensions().get(X_INTERNAL);
862+
boolean isInternal = false;
863+
if (xInternalValue instanceof Boolean) {
864+
isInternal = (Boolean) xInternalValue;
865+
} else if (xInternalValue instanceof String) {
866+
isInternal = Boolean.parseBoolean((String) xInternalValue);
867+
}
868+
if (isInternal) {
869+
property.getExtensions().remove(X_INTERNAL);
870+
}
871+
}
858872
Schema newProperty = normalizeSchema(property, new HashSet<>());
859873
propertiesEntry.setValue(newProperty);
860874
}

0 commit comments

Comments
 (0)