Skip to content

Commit 5e6d94e

Browse files
committed
Merge branch 'master' into allow-empty-models
* master: (121 commits) [PowerShell] better publishing workflow (#7114) [aspnetcore] Typo issues in docs and generated code (#7094) fix http signaure auth in build.sbt (#7110) fix for the issue facing spec invlolving arrayschema structure with ref (#6310) [csharp-netcore] added cancellation tokens to async calls (#7077) [PS] Allow CI to publish the module (#7091) [Dart] Treat float as double (#6924) [Java][jersey2]Fix gradle HttpSignatureAuth dependencies (#7096) move maven,gradle tests to shipppable ci (#7108) [MARKDOWN] Fix issue 6089 with property and parameter names (#6105) [BUG] Multi-Part content type in response ignores properties of composed schema (allOf/oneOf) (#6073) [online] Fix for version conflicts with springfox/boot (#7102) skip some installations to shorten build time [Go][Exp] better code format (#7088) Fix Shippable CI (#7097) typescript-node: clean up require and import (#6947) commented out perl, bash tests to reduce build time Add a link to conference paper (#7086) Add a link to the blog post at qiita (#7084) migrate typescript.sh to new config format (#7078) ...
2 parents d1a8df0 + 1be98b4 commit 5e6d94e

File tree

2,533 files changed

+42679
-22493
lines changed

Some content is hidden

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

2,533 files changed

+42679
-22493
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55

66
- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
77
- [ ] If contributing template-only or documentation-only changes which will change sample output, [build the project](https://github.com/OpenAPITools/openapi-generator#14---build-projects) beforehand.
8-
- [ ] Run the shell script `./bin/generate-samples.sh`to update all Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. 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/config/java*`. For Windows users, please run the script in [Git BASH](https://gitforwindows.org/).
8+
- [ ] Run the shell script `./bin/generate-samples.sh`to update all Petstore samples related to your fix. This is important, as CI jobs will verify _all_ generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. 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*`. For Windows users, please run the script in [Git BASH](https://gitforwindows.org/).
99
- [ ] File the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`
1010
- [ ] Copy the [technical committee](https://github.com/openapitools/openapi-generator/#62---openapi-generator-technical-committee) to review the pull request if your PR is targeting a particular programming language.

.github/workflows/docker-tag-latest-release.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,20 @@ jobs:
2828
- name: DockerHub Login
2929
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin
3030

31-
# Tags openapitools/openapi-generator-online, which is an automated build
31+
# Tags openapitools/openapi-generator-cli
32+
- name: "Tag openapi-generator-cli:x"
33+
id: tag-openapi-generator-cli
34+
if: always()
35+
run: |
36+
echo 'Tagging as latest-release: ${{steps.tagger.outputs.tag}}'
37+
docker pull openapitools/openapi-generator-cli:${{steps.tagger.outputs.tag}}
38+
docker tag openapitools/openapi-generator-cli:${{steps.tagger.outputs.tag}} openapitools/openapi-generator-cli:latest-release
39+
docker push openapitools/openapi-generator-cli:latest-release
40+
41+
# Tags openapitools/openapi-generator-online
3242
- name: "Tag openapi-generator-online:x"
3343
id: tag-openapi-generator-online
44+
if: always()
3445
run: |
3546
echo 'Tagging as latest-release: ${{steps.tagger.outputs.tag}}'
3647
docker pull openapitools/openapi-generator-online:${{steps.tagger.outputs.tag}}
@@ -40,6 +51,7 @@ jobs:
4051
# Tags openapitools/openapi-generator's CLI image (this repo holds CLI + Online via tag prefix)
4152
- name: "Tag openapi-generator:cli-x"
4253
id: tag-cli
54+
if: always()
4355
run: |
4456
echo 'Tagging as latest-release: ${{steps.tagger.outputs.tag}}'
4557
docker pull openapitools/openapi-generator:cli-${{steps.tagger.outputs.tag}}
@@ -49,6 +61,7 @@ jobs:
4961
# Tags openapitools/openapi-generator's ONLINE image (this repo holds CLI + Online via tag prefix)
5062
- name: "Tag openapi-generator:online-x"
5163
id: tag-online
64+
if: always()
5265
run: |
5366
echo 'Tagging as latest-release: ${{steps.tagger.outputs.tag}}'
5467
docker pull openapitools/openapi-generator:online-${{steps.tagger.outputs.tag}}

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ samples/client/petstore/python-tornado/.venv/
177177
samples/client/petstore/typescript-angular2/npm/npm-debug.log
178178
samples/client/petstore/typescript-node/npm/npm-debug.log
179179
samples/client/petstore/typescript-angular/tsd-debug.log
180+
samples/client/petstore/typescript-axios/tests/**/dist/
180181
samples/client/petstore/typescript-fetch/tests/**/dist/
181182

182183
# aspnetcore
@@ -230,7 +231,8 @@ samples/client/petstore/dart/petstore/test/packages
230231
**/.dart_tool
231232

232233
# JS
233-
samples/client/petstore/javascript/package-lock.json
234+
samples/client/petstore/javascript-es6/package-lock.json
235+
samples/client/petstore/javascript-promise-es6/package-lock.json
234236

235237
# elm
236238
samples/client/petstore/elm/index.html

.travis.yml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,13 @@ before_install:
7777
- docker pull swaggerapi/petstore
7878
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
7979
- docker ps -a
80+
# -- skip bash test to shorten build time
8081
# Add bats test framework and cURL for Bash script integration tests
81-
- sudo add-apt-repository ppa:duggan/bats --yes
82-
- sudo apt-get update -qq
83-
- sudo apt-get install -qq bats
84-
- sudo apt-get install -qq curl
82+
#- sudo add-apt-repository ppa:duggan/bats --yes
83+
#- sudo apt-get update -qq
84+
#- sudo apt-get install -qq bats
85+
#- sudo apt-get install -qq curl
86+
# -- skip bash test end
8587
# install dart
8688
#- sudo apt-get update
8789
#- sudo apt-get install apt-transport-https
@@ -93,9 +95,6 @@ before_install:
9395
- phpenv versions
9496
- phpenv global 7.2.15
9597
- php -v
96-
# install perl module
97-
#- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
98-
#- cpanm Test::Exception Test::More Log::Any LWP::UserAgent JSON URI:Query Module::Runtime DateTime Module::Find Moose::Role
9998
# comment out below as installation failed in travis
10099
# Add rebar3 build tool and recent Erlang/OTP for Erlang petstore server tests.
101100
# - Travis CI does not support rebar3 [yet](https://github.com/travis-ci/travis-ci/issues/6506#issuecomment-275189490).
@@ -107,9 +106,11 @@ before_install:
107106
# install Qt5
108107
- sudo apt install -y --no-install-recommends qt5-default
109108
- cmake --version
109+
# -- skip perl test to shorten build time
110110
# perl dep
111111
- cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
112112
- cpanm --quiet --no-interactive Test::Exception Test::More Log::Any LWP::UserAgent URI::Query Module::Runtime DateTime Module::Find Moose::Role JSON || echo "Igorned failure from cpanm"
113+
# -- skip perl test end
113114
# show host table to confirm petstore.swagger.io is mapped to localhost
114115
- cat /etc/hosts
115116
# show java version
@@ -149,14 +150,6 @@ script:
149150
# WARN: Travis will timeout after 10 minutes of no stdout/stderr activity, which is problematic with mvn --quiet.
150151
- mvn --no-snapshot-updates --quiet --batch-mode --show-version clean install -Dorg.slf4j.simpleLogger.defaultLogLevel=error
151152
- mvn --no-snapshot-updates --quiet --batch-mode --show-version verify -Psamples -Dorg.slf4j.simpleLogger.defaultLogLevel=error
152-
# test maven plugin
153-
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/java-client.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
154-
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/multi-module/pom.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
155-
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/kotlin.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
156-
- mvn --no-snapshot-updates --quiet clean compile -f modules/openapi-generator-maven-plugin/examples/spring.xml -Dorg.slf4j.simpleLogger.defaultLogLevel=error
157-
# test gradle plugin
158-
- (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew buildGoSdk)
159-
- (cd modules/openapi-generator-gradle-plugin/samples/local-spec && ./gradlew openApiGenerate)
160153
after_success:
161154
# push to maven repo
162155
- if [ $SONATYPE_USERNAME ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then

CI/circle_parallel.sh

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,11 @@ trap cleanup EXIT
1717
if [ "$NODE_INDEX" = "1" ]; then
1818
echo "Running node $NODE_INDEX to test 'samples.circleci' defined in pom.xml ..."
1919
java -version
20-
# Install golang version 1.14
21-
go version
22-
sudo mkdir /usr/local/go1.14
23-
wget -c https://dl.google.com/go/go1.14.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.14
24-
export PATH="/usr/local/go1.14/go/bin:$PATH"
25-
go version
2620

2721
mvn --no-snapshot-updates --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
28-
mvn --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
22+
23+
echo "show ivy2 cache"
24+
ls -l /home/circleci/.ivy2/cache
2925

3026
elif [ "$NODE_INDEX" = "2" ]; then
3127
# run ensure-up-to-date sample script on SNAPSHOT version only
@@ -40,7 +36,6 @@ elif [ "$NODE_INDEX" = "2" ]; then
4036
# look for outdated samples
4137
./bin/utils/ensure-up-to-date
4238
fi
43-
#elif [ "$NODE_INDEX" = "3" ]; then
4439
echo "Running node $NODE_INDEX to test haskell"
4540
# install haskell
4641
curl -sSL https://get.haskellstack.org/ | sh
@@ -60,10 +55,17 @@ elif [ "$NODE_INDEX" = "2" ]; then
6055
# run integration tests
6156
mvn --no-snapshot-updates --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error
6257
else
63-
echo "Running node $NODE_INDEX to test 'samples.circleci.jdk7' defined in pom.xml ..."
64-
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
58+
echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..."
59+
#sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
6560
java -version
6661

62+
# Install golang version 1.14
63+
go version
64+
sudo mkdir /usr/local/go1.14
65+
wget -c https://dl.google.com/go/go1.14.linux-amd64.tar.gz -O - | sudo tar -xz -C /usr/local/go1.14
66+
export PATH="/usr/local/go1.14/go/bin:$PATH"
67+
go version
68+
6769
# install dart2
6870
sudo apt-get update
6971
sudo apt-get install apt-transport-https
@@ -73,7 +75,8 @@ else
7375
sudo apt-get install dart
7476
export PATH="$PATH:/usr/lib/dart/bin"
7577

76-
mvn --no-snapshot-updates --quiet verify -Psamples.circleci.jdk7 -Dorg.slf4j.simpleLogger.defaultLogLevel=error
78+
mvn --no-snapshot-updates --quiet verify -Psamples.circleci.others -Dorg.slf4j.simpleLogger.defaultLogLevel=error
79+
mvn --no-snapshot-updates --quiet javadoc:javadoc -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error
7780
fi
7881

7982

CONTRIBUTING.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,16 @@ For [Vendor Extensions](https://github.com/OAI/OpenAPI-Specification/blob/master
8585
To add test cases (optional) covering the change in the code generator, please refer to [modules/openapi-generator/src/test/java/org/openapitools/codegen](https://github.com/openapitools/openapi-generator/tree/master/modules/openapi-generator/src/test/java/org/openapitools/codegen)
8686

8787
To test the templates, please perform the following:
88-
- Update the Petstore sample by running the shell scripts under `bin` and `bin/openapi3` folder. For example, run `./bin/python-petstore.sh` and `./bin/openapi3/python-petstore.sh` to update the Python PetStore API client under [`samples/client/petstore/python`](https://github.com/openapitools/openapi-generator/tree/master/samples/client/petstore/python) and [`samples/openapi3/client/petstore/python`](https://github.com/openapitools/openapi-generator/tree/master/samples/openapi3/client/petstore/python). For Windows, the batch files can be found under `bin\windows` folder. (If you find that there are new files generated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec from time to time. If you've questions or concerns, please open a ticket to start a discussion)
89-
- During development it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `./bin/python-petstore.sh -t modules/openapi-generator/src/main/resources/python`.
90-
- Run the tests in the sample folder using maven `mvn integration-test -rf :<artifactId>`, e.g. open a shell in `samples/client/petstore/python`, run `mvn integration-test -rf :PythonPetstoreClientTests`. The artifactId of the project can be found in the pom.xml file. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests)
88+
89+
- Update the Petstore sample by running the shell scripts under the `bin` folder. For example, run `./bin/generate-samples.sh .
90+
/bin/configs/python*` to update the Python-related samples under [`samples`](https://github.com/openapitools/openapi-generator/tree/master/samples). For Windows, please install [GIT bash](https://gitforwindows.org/). (If you find that there are new files g
91+
enerated or unexpected changes as a result of the update, that's not unusual as the test cases are added to the OpenAPI spec fro
92+
m time to time. If you've questions or concerns, please open a ticket to start a discussion)
93+
- During development it can be helpful to quickly regenerate the samples without recompiling all of openapi-generator, e.g. when you have only updated the mustache templates. This can be done by passing the `-t` parameter: `-t modules/openapi-generator/src/main/resources/python`.
94+
- Run the tests in the sample folder using maven `mvn integration-test -f /path/to/pom.xml`, e.g. `mvn integration-test -f samples/client/petstore/python/pom.xml`. (some languages may not contain unit testing for Petstore and we're looking for contribution from the community to implement those tests)
9195
- Finally, git commit the updated samples files: `git commit -a`
9296
(`git add -A` if added files with new test cases)
93-
- For new test cases, please add to the [Fake Petstore spec](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml)
97+
- For new test cases, please add to the [Fake Petstore spec](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml)
9498

9599
To start the CI tests, you can:
96100
- Run `mvn verify -Psamples`, assuming you have all the required tools installed to run tests for different languages.
@@ -105,7 +109,8 @@ See [OpenAPI Tools wiki](https://github.com/OpenAPITools/openapi-generator/wiki/
105109
- Add test case(s) to cover the change
106110
- Document the fix in the code to make the code more readable
107111
- Make sure test cases passed after the change (one way is to leverage https://travis-ci.org/ to run the CI tests)
108-
- File a PR with meaningful title, description and commit messages.
112+
- File a PR with meaningful title, description and commit messages
113+
- Make sure the option "Allow edits from maintainers" in the PR is selected so that the maintainers can update your PRs with minor fixes, if needed.
109114
- Recommended git settings
110115
- `git config core.autocrlf input` to tell Git convert CRLF to LF on commit but not the other way around
111116
- To close an issue (e.g. issue 1542) automatically after a PR is merged, use keywords "fix", "close", "resolve" in the PR description, e.g. `fix #1542`. (Ref: [closing issues using keywords](https://help.github.com/articles/closing-issues-using-keywords/))

0 commit comments

Comments
 (0)