Skip to content

Commit 148faca

Browse files
committed
Merge remote-tracking branch 'origin/master' into feature/multi-filter-normalizer
2 parents cf8992a + a4a24a8 commit 148faca

624 files changed

Lines changed: 90399 additions & 208 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

CI/circle_parallel.sh

Lines changed: 45 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -62,52 +62,51 @@ elif [ "$NODE_INDEX" = "3" ]; then
6262

6363
echo "Running node $NODE_INDEX ... "
6464

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)
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)
111110

112111
else
113112
echo "Running node $NODE_INDEX ..."
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
@@ -818,6 +818,20 @@ protected void normalizeProperties(Map<String, Schema> properties, Set<Schema> v
818818
}
819819
for (Map.Entry<String, Schema> propertiesEntry : properties.entrySet()) {
820820
Schema property = propertiesEntry.getValue();
821+
822+
// remove x-internal if needed (same logic as normalizeComponentsSchemas)
823+
if (property.getExtensions() != null && getRule(REMOVE_X_INTERNAL)) {
824+
Object xInternalValue = property.getExtensions().get(X_INTERNAL);
825+
boolean isInternal = false;
826+
if (xInternalValue instanceof Boolean) {
827+
isInternal = (Boolean) xInternalValue;
828+
} else if (xInternalValue instanceof String) {
829+
isInternal = Boolean.parseBoolean((String) xInternalValue);
830+
}
831+
if (isInternal) {
832+
property.getExtensions().remove(X_INTERNAL);
833+
}
834+
}
821835
Schema newProperty = normalizeSchema(property, new HashSet<>());
822836
propertiesEntry.setValue(newProperty);
823837
}

0 commit comments

Comments
 (0)