Skip to content

Commit

Permalink
Merge branch 'OpenAPITools:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-rosset authored Oct 11, 2021
2 parents b19bb30 + 48f3af1 commit d58e4a2
Show file tree
Hide file tree
Showing 3,013 changed files with 103,113 additions and 33,751 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
machine:
image: circleci/classic:latest
working_directory: ~/OpenAPITools/openapi-generator
parallelism: 3
parallelism: 4
shell: /bin/bash --login
environment:
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/gradle-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Gradle tests (Java samples)

on:
push:
branches:
- master
- '[5-9]+.[0-9]+.x'
- "java*"
paths:
- 'samples/client/petstore/java/**'
pull_request:
branches:
- master
- '[5-9]+.[0-9]+.x'
paths:
- 'samples/openapi3/client/petstore/java/**'
env:
GRADLE_VERSION: 7.2

jobs:
build:
name: Gradle tests
runs-on: ubuntu-latest
container: gradle:jdk8
strategy:
fail-fast: true
matrix:
sample:
- samples/client/petstore/java/jersey2-java8-localdatetime
- samples/client/petstore/java/jersey2-java8
- samples/openapi3/client/extensions/x-auth-id-alias/java/jersey2-java8
- samples/openapi3/client/petstore/java/jersey2-java8-special-characters
- samples/openapi3/client/petstore/java/jersey2-java8
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: 8
# Cache Gradle Dependencies
- name: Setup Gradle Dependencies Cache
uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }}

# Cache Gradle Wrapper
- name: Setup Gradle Wrapper Cache
uses: actions/cache@v2
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}

- name: Build
working-directory: ${{ matrix.sample }}
run: /bin/sh gradlew build -x test
2 changes: 1 addition & 1 deletion .github/workflows/samples-kotlin.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
~/.gradle
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }}
- name: Install Gradle wrapper
uses: eskatos/gradle-command-action@v1
uses: eskatos/gradle-command-action@v2
with:
gradle-version: ${{ env.GRADLE_VERSION }}
build-root-directory: ${{ matrix.sample }}
Expand Down
19 changes: 11 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,17 @@ samples/server-generator/node/output/node_modules
samples/server/petstore/nodejs/node_modules
samples/server/petstore/nodejs-server/node_modules

# qt5 cpp
*.pro.user
samples/client/petstore/qt5cpp/PetStore/moc_*
samples/client/petstore/qt5cpp/PetStore/*.o
samples/client/petstore/qt5cpp/build-*
samples/client/petstore/qt5cpp/PetStore/PetStore
samples/client/petstore/qt5cpp/PetStore/Makefile
samples/client/petstore/qt5cpp/PetStore/PetStore.pro.user
# qt cpp
samples/client/build
samples/client/petstore/build
samples/client/petstore/cpp-qt/PetStore/moc_*
samples/client/petstore/cpp-qt/PetStore/*.o
samples/client/petstore/cpp-qt/build-*
samples/client/petstore/cpp-qt/build-*
samples/client/petstore/cpp-qt/PetStore/PetStore
samples/client/petstore/cpp-qt/PetStore/Makefile
samples/client/petstore/cpp-qt/PetStore/PetStore.pro.user
samples/client/petstore/cpp-qt/CMakeLists.txt.user

# cpprestsdk
samples/client/petstore/cpp-restsdk/CMakeCache.txt
Expand Down
33 changes: 6 additions & 27 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,11 @@ cache:
- $HOME/samples/client/petstore/php/OpenAPIToolsClient-php/vendor
- $HOME/samples/client/petstore/ruby/vendor/bundle
- $HOME/samples/client/petstore/python/.venv/
- $HOME/samples/openapi3/client/petstore/typescript/tests/default/node_modules
- $HOME/samples/openapi3/client/petstore/typescript/tests/jquery/node_modules
- $HOME/samples/openapi3/client/petstore/typescript/tests/object_params/node_modules
- $HOME/samples/openapi3/client/petstore/typescript/tests/inversify/node_modules
- $HOME/samples/client/petstore/typescript-node/npm/node_modules
- $HOME/samples/client/petstore/typescript-node/npm/typings/
- $HOME/samples/client/petstore/typescript-fetch/tests/default/node_modules
- $HOME/samples/client/petstore/typescript-fetch/tests/default/typings
- $HOME/samples/client/petstore/typescript-fetch/builds/default/node_modules
- $HOME/samples/client/petstore/typescript-fetch/builds/default/typings
- $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/node_modules
- $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/typings
- $HOME/samples/client/petstore/typescript-fetch/builds/with-npm-version/node_modules
- $HOME/samples/client/petstore/typescript-fetch/npm/with-npm-version/typings
- $HOME/samples/client/petstore/typescript-angular/node_modules
- $HOME/samples/client/petstore/typescript-angular/typings
- $HOME/samples/server/petstore/rust-server/target
- $HOME/perl5
- $HOME/.cargo
- $HOME/.pub-cache
- $HOME/samples/server/petstore/cpp-pistache/pistache
- $HOME/.npm
- $HOME/.rvm/gems/ruby-2.4.1
- $HOME/website/node_modules/
- $HOME/.cache/deno
Expand Down Expand Up @@ -75,23 +58,19 @@ before_install:
- docker pull swaggerapi/petstore
- docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore
- docker ps -a
# comment out crystal installation as the tests will run on circleci or github action instead
# install crystal
- echo 'deb http://download.opensuse.org/repositories/devel:/languages:/crystal/xUbuntu_16.04/ /' | sudo tee /etc/apt/sources.list.d/devel:languages:crystal.list
- curl -fsSL https://download.opensuse.org/repositories/devel:languages:crystal/xUbuntu_16.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_languages_crystal.gpg > /dev/null
- sudo apt update
- sudo apt install crystal
- crystal --version
#- echo 'deb http://download.opensuse.org/repositories/devel:/languages:/crystal/xUbuntu_16.04/ /' | sudo tee /etc/apt/sources.list.d/devel:languages:crystal.list
#- curl -fsSL https://download.opensuse.org/repositories/devel:languages:crystal/xUbuntu_16.04/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/devel_languages_crystal.gpg > /dev/null
#- sudo apt update
#- sudo apt install crystal
#- crystal --version
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.0
- export PATH="$HOME/.yarn/bin:$PATH"
# install rust
- curl https://sh.rustup.rs -sSf | sh -s -- -y -v
# required when sudo: required for the Ruby petstore tests
- gem install bundler
- nvm install 12.20.0
- nvm use 12.20.0
- npm install -g typescript
- npm install -g npm
- npm config set registry http://registry.npmjs.org/
# set python 3.6.3 as default
- source ~/virtualenv/python3.6/bin/activate
# -- skip bash test to shorten build time
Expand Down
41 changes: 39 additions & 2 deletions CI/.drone.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
kind: pipeline
name: default
type: docker
name: java11-test
steps:
# test Java 11 HTTP client
- name: java11-test
Expand All @@ -15,11 +16,23 @@ steps:
- /bin/bash bin/utils/test-fake-petstore-for-all.sh
# generate test scripts
- /bin/bash bin/tests/run-all-test

---
kind: pipeline
type: docker
name: nim-client-test
steps:
# test nim client
- name: nim-client-test
image: nimlang/nim
commands:
- (cd samples/client/petstore/nim/ && nim c sample_client.nim)

---
kind: pipeline
type: docker
name: protobuf-schema-test
steps:
# test protobuf schema generator
- name: protobuf-schema-test
image: nanoservice/protobuf-go
Expand All @@ -29,12 +42,24 @@ steps:
- cd samples/config/petstore/protobuf-schema
- protoc --go_out=/var/tmp/go/ services/*
- protoc --go_out=/var/tmp/go/ models/*

---
kind: pipeline
type: docker
name: aspnetcore-test
steps:
# test aspnetcore 3.x
- name: aspnetcore-test
image: mcr.microsoft.com/dotnet/core/sdk:3.1
commands:
- (cd samples/server/petstore/aspnetcore-3.1/ && /bin/sh build.sh)
- (cd samples/server/petstore/aspnetcore-3.0/ && /bin/sh build.sh)

---
kind: pipeline
type: docker
name: ocaml-test
steps:
# test ocaml petstore client
- name: ocaml-test
image: ocaml/opam2:4.07
Expand All @@ -46,11 +71,23 @@ steps:
- eval $(opam env)
- sudo chmod -R 777 .
- dune build --build-dir=./_build

---
kind: pipeline
type: docker
name: haskell-client-test
steps:
# test haskell client
- name: haskell-client-test
image: haskell:8.6.5
image: haskell:8.10.4
commands:
- (cd samples/client/petstore/haskell-http-client/ && stack --allow-different-user --install-ghc --no-haddock-deps haddock --fast && stack --allow-different-user test --fast)

---
kind: pipeline
type: docker
name: erlang
steps:
# test erlang client and server
- name: erlang
image: erlang:alpine
Expand Down
26 changes: 20 additions & 6 deletions CI/circle_parallel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ NODE_INDEX=${CIRCLE_NODE_INDEX:-0}

set -e

export NODE_ENV=test

function cleanup {
# Show logs of 'petstore.swagger' container to troubleshoot Unit Test failures, if any.
docker logs petstore.swagger # container name specified in circle.yml
Expand All @@ -20,15 +22,12 @@ if [ "$NODE_INDEX" = "1" ]; then

mvn --no-snapshot-updates --quiet verify -Psamples.circleci -Dorg.slf4j.simpleLogger.defaultLogLevel=error

echo "show ivy2 cache"
ls -l /home/circleci/.ivy2/cache

elif [ "$NODE_INDEX" = "2" ]; then
echo "Running node $NODE_INDEX to test haskell"
# install haskell
curl -sSL https://get.haskellstack.org/ | sh
stack upgrade
stack --version
#curl -sSLk https://get.haskellstack.org/ | sh
#stack upgrade
#stack --version
# prepare r
sudo sh -c 'echo "deb http://cran.rstudio.com/bin/linux/ubuntu trusty/" >> /etc/apt/sources.list'
gpg --keyserver keyserver.ubuntu.com --recv-key E084DAB9
Expand All @@ -43,6 +42,21 @@ elif [ "$NODE_INDEX" = "2" ]; then

# run integration tests
mvn --no-snapshot-updates --quiet verify -Psamples.misc -Dorg.slf4j.simpleLogger.defaultLogLevel=error
elif [ "$NODE_INDEX" = "3" ]; then

echo "Running node $NODE_INDEX to test 'samples.circleci.node3' defined in pom.xml ..."
#wget https://www.python.org/ftp/python/3.8.9/Python-3.8.9.tgz
#tar -xf Python-3.8.9.tgz
#cd Python-3.8.9
#./configure --enable-optimizations
#sudo make altinstall
pyenv install --list
pyenv install 3.6.3
pyenv global 3.6.3
python3 --version

mvn --no-snapshot-updates --quiet verify -Psamples.circleci.node3 -Dorg.slf4j.simpleLogger.defaultLogLevel=error

else
echo "Running node $NODE_INDEX to test 'samples.circleci.others' defined in pom.xml ..."
#sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [Agoda](https://www.agoda.com/)
- [Allianz](https://www.allianz.com)
- [Angular.Schule](https://angular.schule/)
- [Aqovia](https://aqovia.com/)
- [Australia and New Zealand Banking Group (ANZ)](http://www.anz.com/)
- [ASKUL](https://www.askul.co.jp)
- [Arduino](https://www.arduino.cc/)
Expand Down Expand Up @@ -611,6 +612,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [Here](https://developer.here.com/)
- [IBM](https://www.ibm.com/)
- [Instana](https://www.instana.com)
- [Interxion](https://www.interxion.com)
- [Inquisico](https://inquisico.com)
- [JustStar](https://www.juststarinfo.com)
- [k6.io](https://k6.io/)
Expand All @@ -628,6 +630,7 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- [Myworkout](https://myworkout.com)
- [NamSor](https://www.namsor.com/)
- [Neverfail](https://www.neverfail.com/)
- [NeuerEnergy](https://neuerenergy.com)
- [Nokia](https://www.nokia.com/)
- [Options Clearing Corporation (OCC)](https://www.theocc.com/)
- [Openet](https://www.openet.com/)
Expand Down Expand Up @@ -824,6 +827,8 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
- 2021-07-16 - [銀行事業のサーバーサイド開発について / LINE 京都開発室 エンジニア採用説明会](https://www.youtube.com/watch?v=YrrKQHxLPpQ) by 野田誠人, Robert Mitchell
- 2021-07-29 - [How To Rewrite a Huge Codebase](https://dzone.com/articles/how-to-rewrite-a-huge-code-base) by [Curtis Poe](https://dzone.com/users/4565446/publiusovidius.html)
- 2021-08-21 - [Generating Client APIs using Swagger Part 1](https://medium.com/@flowsquad/generating-client-apis-using-swagger-part-1-2d46f13f5e92) by [FlowSquad.io](https://medium.com/@flowsquad)
- 2021-09-11 - [Invoking AWS ParallelCluster API](https://docs.aws.amazon.com/parallelcluster/latest/ug/api-reference-v3.html) at [AWS ParallelCluster API official documentation](https://docs.aws.amazon.com/parallelcluster/latest/ug/api-reference-v3.html)
- 2021-10-02 - [How to Write Fewer Lines of Code with the OpenAPI Generator](https://hackernoon.com/how-to-write-fewer-lines-of-code-with-the-openapi-generator) by [Mikhail Alfa](https://hackernoon.com/u/alphamikle)

## [6 - About Us](#table-of-contents)

Expand Down
11 changes: 11 additions & 0 deletions bin/configs/dart-dio-next-dio-http-petstore-client-lib-fake.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
generatorName: dart-dio-next
outputDir: samples/openapi3/client/petstore/dart-dio-next/dio_http_petstore_client_lib_fake
inputSpec: modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/dart/libraries/dio
typeMappings:
Client: "ModelClient"
File: "ModelFile"
EnumClass: "ModelEnumClass"
additionalProperties:
hideGenerationTimestamp: "true"
dioLibrary: "dio_http"
2 changes: 2 additions & 0 deletions bin/configs/haskell-http-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ generatorName: haskell-http-client
outputDir: samples/client/petstore/haskell-http-client
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/haskell-http-client
additionalProperties:
queryExtraUnreserved: ''
1 change: 1 addition & 0 deletions bin/configs/java-jersey2-8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ additionalProperties:
dateLibrary: java8
useOneOfDiscriminatorLookup: true
disallowAdditionalPropertiesIfNotPresent: false
gradleProperties: "\n# JVM arguments\norg.gradle.jvmargs=-Xmx2024m -XX:MaxPermSize=512m\n# set timeout\norg.gradle.daemon.idletimeout=3600000\n# show all warnings\norg.gradle.warning.mode=all"
11 changes: 11 additions & 0 deletions bin/configs/swift5-asyncAwaitLibrary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
generatorName: swift5
outputDir: samples/client/petstore/swift5/asyncAwaitLibrary
inputSpec: modules/openapi-generator/src/test/resources/2_0/swift/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/swift5
generateAliasAsModel: true
additionalProperties:
responseAs: AsyncAwait
podAuthors: ""
podSummary: PetstoreClient
projectName: PetstoreClient
podHomepage: https://github.com/openapitools/openapi-generator
1 change: 1 addition & 0 deletions bin/configs/swift5-resultLibrary.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ additionalProperties:
podSummary: PetstoreClient
projectName: PetstoreClient
podHomepage: https://github.com/openapitools/openapi-generator
removeMigrationProjectNameClass: true
10 changes: 10 additions & 0 deletions bin/configs/typescript-angular-v12-provided-in-root-with-npm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
generatorName: typescript-angular
outputDir: samples/client/petstore/typescript-angular-v12-provided-in-root/builds/with-npm
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
ngVersion: 12.0.0
npmVersion: 1.0.0
npmName: '@openapitools/typescript-angular-petstore'
npmRepository: https://skimdb.npmjs.com/registry
snapshot: false
6 changes: 6 additions & 0 deletions bin/configs/typescript-angular-v12-provided-in-root.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
generatorName: typescript-angular
outputDir: samples/client/petstore/typescript-angular-v12-provided-in-root/builds/default
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-angular
additionalProperties:
ngVersion: 12.0.0
4 changes: 4 additions & 0 deletions bin/configs/typescript-axios-test-petstore.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
generatorName: typescript-axios
outputDir: samples/client/petstore/typescript-axios/builds/test-petstore
inputSpec: modules/openapi-generator/src/test/resources/3_0/java/petstore-with-fake-endpoints-models-for-testing-with-http-signature.yaml
templateDir: modules/openapi-generator/src/main/resources/typescript-axios
2 changes: 1 addition & 1 deletion docs/generators.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The following generators are available:
* [dart](generators/dart.md)
* [dart-dio](generators/dart-dio.md)
* [dart-dio-next (experimental)](generators/dart-dio-next.md)
* [dart-jaguar](generators/dart-jaguar.md)
* [dart-jaguar (deprecated)](generators/dart-jaguar.md)
* [eiffel](generators/eiffel.md)
* [elixir](generators/elixir.md)
* [elm](generators/elm.md)
Expand Down
Loading

0 comments on commit d58e4a2

Please sign in to comment.