forked from loafle/openapi-generator-original
Compare commits
215 Commits
travis_tes
...
v3.2.2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3259bf71e6 | ||
|
|
526e980a69 | ||
|
|
ab09909f99 | ||
|
|
d8b597b168 | ||
|
|
9bc335b35e | ||
|
|
227f2779d7 | ||
|
|
2ffda45adf | ||
|
|
bb2712fe45 | ||
|
|
cbf61d5524 | ||
|
|
39763a8ca7 | ||
|
|
aa19369466 | ||
|
|
3f65d6c350 | ||
|
|
99646e6436 | ||
|
|
450d624474 | ||
|
|
ca0c35aa15 | ||
|
|
fcfd8ea76e | ||
|
|
2044c36398 | ||
|
|
d374e1c160 | ||
|
|
ee491a0e5e | ||
|
|
e605882451 | ||
|
|
b91c8e17a7 | ||
|
|
dcc622d374 | ||
|
|
a3e5edc367 | ||
|
|
bd7c9e30d3 | ||
|
|
62dfb749f1 | ||
|
|
3b9de3baa3 | ||
|
|
d593988e5d | ||
|
|
0191210145 | ||
|
|
0f30a052b2 | ||
|
|
1c6ab3f831 | ||
|
|
5ffc297a69 | ||
|
|
e7340bfe5b | ||
|
|
ca651becf8 | ||
|
|
6de09688ad | ||
|
|
94806b8036 | ||
|
|
fa52826c24 | ||
|
|
7b8f51a465 | ||
|
|
79b993e6d5 | ||
|
|
56bba880e7 | ||
|
|
7acba8a4d8 | ||
|
|
08ca54d3d5 | ||
|
|
7b04732f09 | ||
|
|
b64864f47d | ||
|
|
c237fe9f1c | ||
|
|
5e1c4cde50 | ||
|
|
1559c4fadd | ||
|
|
0cd6d8c139 | ||
|
|
ddb0920fed | ||
|
|
21777f2759 | ||
|
|
afdef8f890 | ||
|
|
d019bbd2c7 | ||
|
|
748d1d70cb | ||
|
|
987fd77042 | ||
|
|
a0984a9be8 | ||
|
|
9920c435ca | ||
|
|
4060fcbb8b | ||
|
|
d0ccac5663 | ||
|
|
06263d7606 | ||
|
|
3245c0a139 | ||
|
|
0809d8f527 | ||
|
|
baf16cf834 | ||
|
|
629608c573 | ||
|
|
e143214685 | ||
|
|
2340d83a33 | ||
|
|
90a8b81728 | ||
|
|
30fb22fffa | ||
|
|
f329872ce7 | ||
|
|
05db32fea2 | ||
|
|
c116c8fb9b | ||
|
|
1ab4fe43b5 | ||
|
|
f6c21057e1 | ||
|
|
c9085b4f2b | ||
|
|
f6146b212f | ||
|
|
2b429ee43b | ||
|
|
a258cf3fc6 | ||
|
|
07a5715b9f | ||
|
|
f32398a708 | ||
|
|
f0425d77ef | ||
|
|
e0020b41da | ||
|
|
375c26ccb3 | ||
|
|
40024ac72a | ||
|
|
ab08dd1d26 | ||
|
|
21141f682f | ||
|
|
d8ea28e147 | ||
|
|
82156b6639 | ||
|
|
3085bf1df5 | ||
|
|
58e0946b1e | ||
|
|
f793ac25c7 | ||
|
|
d1fc923b66 | ||
|
|
f1897c4462 | ||
|
|
d8ec6b2003 | ||
|
|
824654964b | ||
|
|
0c52fcd5ff | ||
|
|
926b971497 | ||
|
|
1e95d36809 | ||
|
|
a3e5185e39 | ||
|
|
1cbfca4887 | ||
|
|
b0909ade6f | ||
|
|
036fa6918c | ||
|
|
b587052de4 | ||
|
|
cb9a734ebb | ||
|
|
01dbb8b693 | ||
|
|
68d80ab67d | ||
|
|
14ab3d763e | ||
|
|
3c3ac0a071 | ||
|
|
0b88889cdf | ||
|
|
b33f1f945b | ||
|
|
c7953ac137 | ||
|
|
534b6b5978 | ||
|
|
b6fc29050d | ||
|
|
7e494e52ab | ||
|
|
7624a1ff85 | ||
|
|
1d72edddf6 | ||
|
|
c9b934147a | ||
|
|
65bad61abb | ||
|
|
77df3d6770 | ||
|
|
a8e8acead7 | ||
|
|
44d419c1a1 | ||
|
|
60c81eae0a | ||
|
|
00246f3ea0 | ||
|
|
6f19fa7e91 | ||
|
|
70cdd27e75 | ||
|
|
c6004a8f89 | ||
|
|
85f0909c7f | ||
|
|
37be47fc56 | ||
|
|
86d7009f4c | ||
|
|
530065137d | ||
|
|
59d38d7dd2 | ||
|
|
59bd3b6dcb | ||
|
|
27a356dacf | ||
|
|
2e1add83e7 | ||
|
|
2e6bec7345 | ||
|
|
667e3130fe | ||
|
|
a9961a062a | ||
|
|
af3ca293e4 | ||
|
|
d42ff75ceb | ||
|
|
4156bb9f01 | ||
|
|
5328f103da | ||
|
|
1dee3e227c | ||
|
|
0da55081c9 | ||
|
|
af9d57e4b9 | ||
|
|
8867d2b34c | ||
|
|
eeda132e73 | ||
|
|
97d6b71460 | ||
|
|
1b2d12286f | ||
|
|
c70ed678f6 | ||
|
|
ab9be95442 | ||
|
|
71ef6a0a2b | ||
|
|
888da52181 | ||
|
|
bd33a333af | ||
|
|
f7617bc628 | ||
|
|
c5e170961f | ||
|
|
e02e875978 | ||
|
|
52cd17ecc7 | ||
|
|
76160b53c7 | ||
|
|
80cf1324c5 | ||
|
|
0f0d8a01cb | ||
|
|
995edc0b75 | ||
|
|
5344a02bbc | ||
|
|
45ed374b62 | ||
|
|
1e596496a5 | ||
|
|
761799abf5 | ||
|
|
baaa335664 | ||
|
|
0a52f56ba4 | ||
|
|
7c9d40016f | ||
|
|
1d53ed5095 | ||
|
|
6d6ef0f120 | ||
|
|
afb238814d | ||
|
|
a055dc0351 | ||
|
|
84ef98f067 | ||
|
|
925ae68167 | ||
|
|
d863c3e5f4 | ||
|
|
5a0a8f6a87 | ||
|
|
df815344d1 | ||
|
|
a6e15d7569 | ||
|
|
478d6ced4e | ||
|
|
791f836e3d | ||
|
|
cd854b2130 | ||
|
|
26e70fe642 | ||
|
|
0cc60d39d2 | ||
|
|
6c14b4271f | ||
|
|
19fd48e33b | ||
|
|
93832340a5 | ||
|
|
a0936bec02 | ||
|
|
a18a50b7a4 | ||
|
|
d17bdd2658 | ||
|
|
84129a7da1 | ||
|
|
0d952b79db | ||
|
|
0a2131d2d3 | ||
|
|
86a0445984 | ||
|
|
837b10aab5 | ||
|
|
9103ddb7fa | ||
|
|
96e86ac03e | ||
|
|
950c584485 | ||
|
|
6d05ea5716 | ||
|
|
79fafda012 | ||
|
|
a14e757059 | ||
|
|
8f6bb8d9ec | ||
|
|
b380e8f2a9 | ||
|
|
0d959a254c | ||
|
|
23c04e2e66 | ||
|
|
4797c7b42c | ||
|
|
4b6fb504a2 | ||
|
|
100ec449fe | ||
|
|
790f3d46aa | ||
|
|
7404ecb11e | ||
|
|
a714bf4720 | ||
|
|
9eeedede49 | ||
|
|
3408866b79 | ||
|
|
804094bf51 | ||
|
|
869b17fe29 | ||
|
|
867aaa4c27 | ||
|
|
d43801a9b7 | ||
|
|
7eb2acaf71 | ||
|
|
0bffdf2463 |
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -2,7 +2,7 @@
|
||||
|
||||
- [ ] Read the [contribution guidelines](https://github.com/openapitools/openapi-generator/blob/master/CONTRIBUTING.md).
|
||||
- [ ] Ran the shell script under `./bin/` to update Petstore sample so that CIs can verify the change. (For instance, only need to run `./bin/{LANG}-petstore.sh` and `./bin/security/{LANG}-petstore.sh` if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in `.\bin\windows\`.
|
||||
- [ ] Filed the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `3.1.x`, `4.0.x`. Default: `master`.
|
||||
- [ ] Filed the PR against the [correct branch](https://github.com/OpenAPITools/openapi-generator/wiki/Git-Branches): `master`, `3.3.x`, `4.0.x`. Default: `master`.
|
||||
- [ ] Copied 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.
|
||||
|
||||
### Description of the PR
|
||||
|
||||
25
.gitignore
vendored
25
.gitignore
vendored
@@ -59,6 +59,12 @@ samples/client/petstore/qt5cpp/PetStore/PetStore
|
||||
samples/client/petstore/qt5cpp/PetStore/Makefile
|
||||
samples/client/petstore/qt5cpp/PetStore/PetStore.pro.user
|
||||
|
||||
# cpprestsdk
|
||||
samples/client/petstore/cpp-restsdk/CMakeCache.txt
|
||||
samples/client/petstore/cpp-restsdk/CMakeFiles/
|
||||
samples/client/petstore/cpp-restsdk/Makefile
|
||||
samples/client/petstore/cpp-restsdk/cmake_install.cmake
|
||||
|
||||
#Java/Android
|
||||
**/.gradle
|
||||
samples/client/petstore/java/hello.txt
|
||||
@@ -83,19 +89,9 @@ samples/client/petstore/scala/build/
|
||||
samples/client/petstore/java/resttemplate/hello.txt
|
||||
samples/client/petstore/java/retrofit2/hello.txt
|
||||
samples/client/petstore/java/feign/hello.txt
|
||||
|
||||
#PHP
|
||||
samples/client/petstore/php/OpenAPIToolsClient-php/composer.lock
|
||||
samples/client/petstore/php/OpenAPIToolsClient-php/vendor/
|
||||
samples/client/petstore/silex/SwaggerServer/composer.lock
|
||||
samples/client/petstore/silex/SwaggerServer/venodr/
|
||||
**/vendor/
|
||||
**/composer.lock
|
||||
|
||||
#PHP-Symfony
|
||||
samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/cache/
|
||||
samples/server/petstore/php-symfony/SymfonyBundle-php/Tests/logs/
|
||||
|
||||
samples/client/petstore/java/jersey2-java6/project/
|
||||
samples/client/petstore/java/jersey2-java8/project/
|
||||
samples/client/petstore/java/jersey2/project/
|
||||
|
||||
# Perl
|
||||
samples/client/petstore/perl/deep_module_test/
|
||||
@@ -158,6 +154,9 @@ samples/client/petstore/python/swagger_client.egg-info/SOURCES.txt
|
||||
samples/client/petstore/python/.coverage
|
||||
samples/client/petstore/python/.projectile
|
||||
samples/client/petstore/python/.venv/
|
||||
samples/client/petstore/python-asyncio/.venv/
|
||||
samples/client/petstore/python-asyncio/.pytest_cache/
|
||||
samples/client/petstore/python-tornado/.venv/
|
||||
|
||||
# ts
|
||||
samples/client/petstore/typescript-node/npm/node_modules
|
||||
|
||||
36
.hub.cli.dockerfile
Normal file
36
.hub.cli.dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
## The builder labeled image acts as a transient container which is meant to
|
||||
## hold all non-artifact code.
|
||||
##
|
||||
## You can build _just_ this part with:
|
||||
## docker --target builder -t container-name:builder -f .hub.cli.dockerfile .
|
||||
FROM jimschubert/8-jdk-alpine-mvn:1.0 as builder
|
||||
|
||||
RUN set -x && \
|
||||
apk add --no-cache bash
|
||||
|
||||
ENV GEN_DIR /opt/openapi-generator
|
||||
WORKDIR ${GEN_DIR}
|
||||
COPY . ${GEN_DIR}
|
||||
|
||||
# Pre-compile openapi-generator-cli
|
||||
RUN mvn -am -pl "modules/openapi-generator-cli" package
|
||||
|
||||
## The final (release) image
|
||||
## The resulting container here only needs the target jar
|
||||
## and ca-certificates (to be able to query HTTPS hosted specs)
|
||||
FROM openjdk:8-jre-alpine
|
||||
|
||||
ENV GEN_DIR /opt/openapi-generator
|
||||
|
||||
RUN apk --no-cache add ca-certificates bash
|
||||
RUN mkdir -p ${GEN_DIR}/modules/openapi-generator-cli/target
|
||||
|
||||
WORKDIR ${GEN_DIR}/modules/openapi-generator-cli/target
|
||||
|
||||
COPY --from=builder ${GEN_DIR}/modules/openapi-generator-cli/target/openapi-generator-cli.jar ${GEN_DIR}/modules/openapi-generator-cli/target/openapi-generator-cli.jar
|
||||
|
||||
COPY docker-entrypoint.sh /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
|
||||
CMD ["help"]
|
||||
35
.hub.online.dockerfile
Normal file
35
.hub.online.dockerfile
Normal file
@@ -0,0 +1,35 @@
|
||||
## The builder labeled image acts as a transient container which is meant to
|
||||
## hold all non-artifact code.
|
||||
##
|
||||
## You can build _just_ this part with:
|
||||
## docker --target builder -t container-name:builder -f .hub.online.dockerfile .
|
||||
FROM jimschubert/8-jdk-alpine-mvn:1.0 as builder
|
||||
|
||||
RUN set -x && \
|
||||
apk add --no-cache bash
|
||||
|
||||
ENV GEN_DIR /opt/openapi-generator
|
||||
WORKDIR ${GEN_DIR}
|
||||
COPY . ${GEN_DIR}
|
||||
|
||||
# Pre-compile openapi-generator-online
|
||||
RUN mvn -am -pl "modules/openapi-generator-online" package
|
||||
|
||||
## The final (release) image
|
||||
## The resulting container here only needs the target jar
|
||||
FROM openjdk:8-jre-alpine
|
||||
|
||||
ENV GEN_DIR /opt/openapi-generator
|
||||
ENV TARGET_DIR /generator
|
||||
|
||||
RUN mkdir -p ${TARGET_DIR}
|
||||
|
||||
WORKDIR ${TARGET_DIR}
|
||||
|
||||
COPY --from=builder ${GEN_DIR}/modules/openapi-generator-online/target/openapi-generator-*.jar ${TARGET_DIR}/openapi-generator-online.jar
|
||||
|
||||
ENV GENERATOR_HOST=http://localhost
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
CMD ["java", "-jar", "/generator/openapi-generator-online.jar"]
|
||||
46
.travis.yml
46
.travis.yml
@@ -30,12 +30,18 @@ cache:
|
||||
- $HOME/perl5
|
||||
- $HOME/.cargo
|
||||
- $HOME/.stack
|
||||
- $HOME/samples/server/petstore/cpp-pistache/pistache
|
||||
|
||||
services:
|
||||
- docker
|
||||
|
||||
# comment out the host table change to use the public petstore server
|
||||
addons:
|
||||
apt:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
packages:
|
||||
- g++-5
|
||||
chrome: stable
|
||||
hosts:
|
||||
- petstore.swagger.io
|
||||
@@ -86,10 +92,13 @@ before_install:
|
||||
|
||||
install:
|
||||
# Add Godeps dependencies to GOPATH and PATH
|
||||
- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.4 bash)"
|
||||
- export GOPATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace"
|
||||
#- eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.4 bash)"
|
||||
#- export GOPATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace"
|
||||
- export PATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace/bin:$HOME/.cargo/bin:$PATH"
|
||||
- go version
|
||||
#- go version
|
||||
- gcc -v
|
||||
- echo $CC
|
||||
- echo $CXX
|
||||
|
||||
script:
|
||||
# fail fast
|
||||
@@ -114,7 +123,7 @@ after_success:
|
||||
./gradlew -Psigning.keyId="$SIGNING_KEY" -Psigning.password="$SIGNING_PASSPHRASE" -Psigning.secretKeyRingFile="${TRAVIS_BUILD_DIR}/sec.gpg" -PossrhUsername="${SONATYPE_USERNAME}" -PossrhPassword="${SONATYPE_PASSWORD}" uploadArchives --no-daemon;
|
||||
echo "Finished ./gradlew uploadArchives";
|
||||
popd;
|
||||
elif ([ "$TRAVIS_BRANCH" == "3.1.x" ] || [ "$TRAVIS_BRANCH" == "4.0.x" ]) ; then
|
||||
elif ([ "$TRAVIS_BRANCH" == "4.0.x" ]) ; then
|
||||
mvn clean deploy --settings CI/settings.xml;
|
||||
echo "Finished mvn clean deploy for $TRAVIS_BRANCH";
|
||||
pushd .;
|
||||
@@ -124,27 +133,10 @@ after_success:
|
||||
popd;
|
||||
fi;
|
||||
fi;
|
||||
## docker build and push images to DockerHub (openapi-generator-online, openapi-generator-cli)
|
||||
- if [ $DOCKER_HUB_USERNAME ]; then
|
||||
read -r MVN_VERSION_FOR_DOCKER_TAG < target/ci/version-for-docker-tag.txt;
|
||||
echo "Tag for Docker derived from maven version -> $MVN_VERSION_FOR_DOCKER_TAG";
|
||||
echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin;
|
||||
if [ ! -z "$TRAVIS_TAG" ]; then
|
||||
docker build -t $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-online;
|
||||
docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-cli;
|
||||
elif [ "$TRAVIS_BRANCH" == "master" ]; then
|
||||
docker build -t $DOCKER_GENERATOR_IMAGE_NAME -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-online;
|
||||
docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-cli;
|
||||
else
|
||||
docker build -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-online;
|
||||
docker build -t $DOCKER_GENERATOR_IMAGE_NAME:$MVN_VERSION_FOR_DOCKER_TAG ./modules/openapi-generator-cli;
|
||||
fi;
|
||||
if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" == "master" ] || [ "$TRAVIS_BRANCH" == "3.1.x" ] || [ "$TRAVIS_BRANCH" == "4.0.x" ]; then
|
||||
docker push $DOCKER_GENERATOR_IMAGE_NAME;
|
||||
echo "Pushed to $DOCKER_GENERATOR_IMAGE_NAME";
|
||||
docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME;
|
||||
echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME";
|
||||
fi;
|
||||
fi;
|
||||
## docker: build and push openapi-generator-online to DockerHub
|
||||
- if [ $DOCKER_HUB_USERNAME ]; then echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin && docker build -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/openapi-generator-online && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME && echo "Pushed to $DOCKER_GENERATOR_IMAGE_NAME"; fi; fi
|
||||
## docker: build cli image and push to Docker Hub
|
||||
- if [ $DOCKER_HUB_USERNAME ]; then echo "$DOCKER_HUB_PASSWORD" | docker login --username=$DOCKER_HUB_USERNAME --password-stdin && docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/openapi-generator-cli && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME && echo "Pushed to $DOCKER_CODEGEN_CLI_IMAGE_NAME"; fi; fi
|
||||
|
||||
env:
|
||||
- DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test
|
||||
- DOCKER_GENERATOR_IMAGE_NAME=openapitools/openapi-generator-online DOCKER_CODEGEN_CLI_IMAGE_NAME=openapitools/openapi-generator-cli NODE_ENV=test CC=gcc-5 CXX=g++-5
|
||||
|
||||
29
CI/.travis.yml.jdk6
Normal file
29
CI/.travis.yml.jdk6
Normal file
@@ -0,0 +1,29 @@
|
||||
dist: trusty
|
||||
sudo: required
|
||||
language: java
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- openjdk-6-jdk
|
||||
jdk: openjdk6
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.m2
|
||||
- $HOME/.ivy2
|
||||
- $HOME/.gradle/caches/
|
||||
- $HOME/.gradle/wrapper/
|
||||
|
||||
install:
|
||||
- jdk_switcher use openjdk6
|
||||
- java -version
|
||||
- curl -s "https://get.sdkman.io" | bash
|
||||
- source "$HOME/.sdkman/bin/sdkman-init.sh"
|
||||
- sdk version
|
||||
- sdk install gradle 2.9
|
||||
- sdk list gradle
|
||||
- sdk version
|
||||
- gradle --version
|
||||
|
||||
script:
|
||||
- cd samples/client/petstore/java/jersey2-java6 && gradle test
|
||||
19
CI/circle_parallel.sh
Executable file
19
CI/circle_parallel.sh
Executable file
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
NODE_INDEX=${CIRCLE_NODE_INDEX:-0}
|
||||
|
||||
|
||||
if [ "$NODE_INDEX" = "1" ]; then
|
||||
echo "Running node $NODE_INDEX to test CI/pom.xml.circleci ..."
|
||||
cp CI/pom.xml.circleci pom.xml
|
||||
java -version
|
||||
mvn --quiet verify -Psamples
|
||||
else
|
||||
echo "Running node $NODE_INDEX to test CI/pom.xml.circleci.java7 ..."
|
||||
sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
|
||||
java -version
|
||||
cp CI/pom.xml.circleci.java7 pom.xml
|
||||
mvn --quiet verify -Psamples
|
||||
fi
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>openapi-generator-project</name>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.2.2</version>
|
||||
<url>https://github.com/openapi-tools/openapi-generator</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:openapi-tools/openapi-generator.git</connection>
|
||||
@@ -920,7 +920,7 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<swagger-parser-version>2.0.1</swagger-parser-version>
|
||||
<swagger-parser-version>2.0.2-OpenAPITools.org-1</swagger-parser-version>
|
||||
<swagger-core-version>2.0.1</swagger-core-version>
|
||||
<scala-version>2.11.1</scala-version>
|
||||
<felix-version>3.3.0</felix-version>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>openapi-generator-project</name>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.2.2</version>
|
||||
<url>https://github.com/openapitools/openapi-generator</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>
|
||||
@@ -607,6 +607,55 @@
|
||||
<module>samples/server/petstore/jaxrs/jersey1</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<!-- openapi v3's one -->
|
||||
<id>jaxrs-jersey</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env</name>
|
||||
<value>java</value>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/server/petstore/jaxrs-jersey</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jaxrs-spec</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env</name>
|
||||
<value>java</value>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/server/petstore/jaxrs-spec</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jaxrs-spec-interface</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env</name>
|
||||
<value>java</value>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/server/petstore/jaxrs-spec-interface</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jaxrs-spec-interface-response</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env</name>
|
||||
<value>java</value>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/server/petstore/jaxrs-spec-interface-response</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>typescript-fetch-client-tests-default</id>
|
||||
<activation>
|
||||
@@ -844,10 +893,12 @@
|
||||
<module>samples/client/petstore/java/feign</module>
|
||||
<module>samples/client/petstore/java/jersey1</module>
|
||||
<module>samples/client/petstore/java/jersey2</module>
|
||||
<module>samples/client/petstore/java/jersey2-java8</module>
|
||||
<module>samples/client/petstore/java/okhttp-gson</module>
|
||||
<module>samples/client/petstore/java/retrofit</module>
|
||||
<module>samples/client/petstore/java/retrofit2</module>
|
||||
<module>samples/client/petstore/java/retrofit2rx</module>
|
||||
<module>samples/client/petstore/java/retrofit2-play25</module>
|
||||
<module>samples/client/petstore/jaxrs-cxf-client</module>
|
||||
<module>samples/client/petstore/java/resttemplate</module>
|
||||
<module>samples/client/petstore/java/resttemplate-withXml</module>
|
||||
@@ -860,6 +911,10 @@
|
||||
<module>samples/client/petstore/kotlin-threetenbp/</module>
|
||||
<module>samples/client/petstore/kotlin-string/</module>
|
||||
<!-- servers -->
|
||||
<module>samples/server/petstore/jaxrs-jersey</module>
|
||||
<module>samples/server/petstore/jaxrs-spec</module>
|
||||
<module>samples/server/petstore/jaxrs-spec-interface</module>
|
||||
<module>samples/server/petstore/jaxrs-spec-interface-response</module>
|
||||
<module>samples/server/petstore/java-vertx/rx</module>
|
||||
<module>samples/server/petstore/java-vertx/async</module>
|
||||
<module>samples/server/petstore/java-inflector</module>
|
||||
@@ -899,7 +954,6 @@
|
||||
<module>samples/server/petstore/jaxrs-cxf-cdi</module>
|
||||
<module>samples/server/petstore/jaxrs-cxf-non-spring-app</module>
|
||||
<module>samples/server/petstore/java-msf4j</module>
|
||||
<module>samples/server/petstore/jaxrs-spec-interface</module>
|
||||
<module>samples/server/petstore/scala-lagom-server</module>
|
||||
<module>samples/server/petstore/scalatra</module>
|
||||
<module>samples/server/petstore/finch</module>
|
||||
@@ -974,7 +1028,7 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<swagger-parser-version>2.0.1</swagger-parser-version>
|
||||
<swagger-parser-version>2.0.2-OpenAPITools.org-1</swagger-parser-version>
|
||||
<swagger-core-version>2.0.1</swagger-core-version>
|
||||
<scala-version>2.11.1</scala-version>
|
||||
<felix-version>3.3.0</felix-version>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>openapi-generator-project</name>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.2.2</version>
|
||||
<url>https://github.com/openapitools/openapi-generator</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>
|
||||
@@ -607,6 +607,55 @@
|
||||
<module>samples/server/petstore/jaxrs/jersey1</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<!-- openapi v3's one -->
|
||||
<id>jaxrs-jersey</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env</name>
|
||||
<value>java</value>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/server/petstore/jaxrs-jersey</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jaxrs-spec</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env</name>
|
||||
<value>java</value>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/server/petstore/jaxrs-spec</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jaxrs-spec-interface</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env</name>
|
||||
<value>java</value>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/server/petstore/jaxrs-spec-interface</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>jaxrs-spec-interface-response</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>env</name>
|
||||
<value>java</value>
|
||||
</property>
|
||||
</activation>
|
||||
<modules>
|
||||
<module>samples/server/petstore/jaxrs-spec-interface-response</module>
|
||||
</modules>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>typescript-fetch-client-tests-default</id>
|
||||
<activation>
|
||||
@@ -852,10 +901,11 @@
|
||||
<module>samples/client/petstore/java/resteasy</module>
|
||||
<module>samples/client/petstore/java/google-api-client</module>
|
||||
<module>samples/client/petstore/kotlin/</module>
|
||||
<!-- test non-java projects -->
|
||||
<!--<module>samples/client/petstore/go</module>-->
|
||||
<module>samples/client/petstore/typescript-angular-v6-provided-in-root</module>
|
||||
<!-- servers -->
|
||||
<module>samples/server/petstore/jaxrs-jersey</module>
|
||||
<module>samples/server/petstore/jaxrs-spec</module>
|
||||
<module>samples/server/petstore/jaxrs-spec-interface</module>
|
||||
<module>samples/server/petstore/jaxrs-spec-interface-response</module>
|
||||
<module>samples/server/petstore/java-vertx/rx</module>
|
||||
<module>samples/server/petstore/java-vertx/async</module>
|
||||
<module>samples/server/petstore/java-inflector</module>
|
||||
@@ -879,7 +929,6 @@
|
||||
<module>samples/server/petstore/jaxrs-cxf-cdi</module>
|
||||
<module>samples/server/petstore/jaxrs-cxf-non-spring-app</module>
|
||||
<module>samples/server/petstore/java-msf4j</module>
|
||||
<module>samples/server/petstore/jaxrs-spec-interface</module>
|
||||
</modules>
|
||||
</profile>
|
||||
</profiles>
|
||||
@@ -951,7 +1000,7 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<swagger-parser-version>2.0.1</swagger-parser-version>
|
||||
<swagger-parser-version>2.0.2-OpenAPITools.org-1</swagger-parser-version>
|
||||
<swagger-core-version>2.0.1</swagger-core-version>
|
||||
<scala-version>2.11.1</scala-version>
|
||||
<felix-version>3.3.0</felix-version>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
<name>openapi-generator-project</name>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.2.2</version>
|
||||
<url>https://github.com/openapitools/openapi-generator</url>
|
||||
<scm>
|
||||
<connection>scm:git:git@github.com:openapitools/openapi-generator.git</connection>
|
||||
@@ -928,7 +928,7 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
<properties>
|
||||
<swagger-parser-version>2.0.1</swagger-parser-version>
|
||||
<swagger-parser-version>2.0.2-OpenAPITools.org-1</swagger-parser-version>
|
||||
<swagger-core-version>2.0.1</swagger-core-version>
|
||||
<scala-version>2.11.1</scala-version>
|
||||
<felix-version>3.3.0</felix-version>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.x
|
||||
122
CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle
Normal file
122
CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle
Normal file
@@ -0,0 +1,122 @@
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
group = 'org.openapitools'
|
||||
version = '1.0.0'
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
jcenter {
|
||||
url "http://jcenter.bintray.com/"
|
||||
}
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:2.3.+'
|
||||
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
jcenter {
|
||||
url "http://jcenter.bintray.com/"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(hasProperty('target') && target == 'android') {
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
apply plugin: 'com.github.dcendents.android-maven'
|
||||
|
||||
android {
|
||||
compileSdkVersion 25
|
||||
buildToolsVersion '25.0.2'
|
||||
defaultConfig {
|
||||
minSdkVersion 14
|
||||
targetSdkVersion 25
|
||||
}
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_1_6
|
||||
targetCompatibility JavaVersion.VERSION_1_6
|
||||
}
|
||||
|
||||
// Rename the aar correctly
|
||||
libraryVariants.all { variant ->
|
||||
variant.outputs.each { output ->
|
||||
def outputFile = output.outputFile
|
||||
if (outputFile != null && outputFile.name.endsWith('.aar')) {
|
||||
def fileName = "${project.name}-${variant.baseName}-${version}.aar"
|
||||
output.outputFile = new File(outputFile.parent, fileName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
provided 'javax.annotation:jsr250-api:1.0'
|
||||
}
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
android.libraryVariants.all { variant ->
|
||||
def task = project.tasks.create "jar${variant.name.capitalize()}", Jar
|
||||
task.description = "Create jar artifact for ${variant.name}"
|
||||
task.dependsOn variant.javaCompile
|
||||
task.from variant.javaCompile.destinationDir
|
||||
task.destinationDir = project.file("${project.buildDir}/outputs/jar")
|
||||
task.archiveName = "${project.name}-${variant.baseName}-${version}.jar"
|
||||
artifacts.add('archives', task);
|
||||
}
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
from android.sourceSets.main.java.srcDirs
|
||||
classifier = 'sources'
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives sourcesJar
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven'
|
||||
sourceCompatibility = JavaVersion.VERSION_1_6
|
||||
targetCompatibility = JavaVersion.VERSION_1_6
|
||||
|
||||
install {
|
||||
repositories.mavenInstaller {
|
||||
pom.artifactId = 'petstore-jersey2-java6'
|
||||
}
|
||||
}
|
||||
|
||||
task execute(type:JavaExec) {
|
||||
main = System.getProperty('mainClass')
|
||||
classpath = sourceSets.main.runtimeClasspath
|
||||
}
|
||||
}
|
||||
|
||||
ext {
|
||||
swagger_annotations_version = "1.5.20"
|
||||
jackson_version = "2.9.6"
|
||||
jersey_version = "2.6"
|
||||
commons_io_version=2.5
|
||||
commons_lang3_version=3.6
|
||||
junit_version = "4.12"
|
||||
threetenbp_version = "2.6.4"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "io.swagger:swagger-annotations:$swagger_annotations_version"
|
||||
compile "org.glassfish.jersey.core:jersey-client:$jersey_version"
|
||||
compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version"
|
||||
compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version"
|
||||
compile "com.fasterxml.jackson.core:jackson-core:$jackson_version"
|
||||
compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version"
|
||||
compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version"
|
||||
compile "commons-io:commons-io:$commons_io_version"
|
||||
compile "org.apache.commons:commons-lang3:$commons_lang3_version"
|
||||
compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$threetenbp_version"
|
||||
compile "com.brsanthu:migbase64:2.2"
|
||||
testCompile "junit:junit:$junit_version"
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public class ApiClientTest {
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00")));
|
||||
|
||||
// custom date format: without milli-seconds, custom time zone
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT);
|
||||
format.setTimeZone(TimeZone.getTimeZone("GMT+10"));
|
||||
apiClient.setDateFormat(format);
|
||||
dateStr = "2015-11-07T13:49:09+10:00";
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ApiClientTest {
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00")));
|
||||
|
||||
// custom date format: without milli-seconds, custom time zone
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT);
|
||||
format.setTimeZone(TimeZone.getTimeZone("GMT+10"));
|
||||
apiClient.setDateFormat(format);
|
||||
dateStr = "2015-11-07T13:49:09+10:00";
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.text.SimpleDateFormat;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.Locale;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import okio.ByteString;
|
||||
@@ -46,7 +47,7 @@ public class JSONTest {
|
||||
assertEquals(json.deserialize("\"2015-11-07T03:49:09.356" + getCurrentTimezoneOffset() + "\"", java.sql.Date.class).toString(), date.toString());
|
||||
|
||||
// custom date format: without day
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM");
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM", Locale.ROOT);
|
||||
apiClient.setSqlDateFormat(format);
|
||||
String dateStr = "\"2015-11\"";
|
||||
assertEquals(dateStr, json.serialize(json.deserialize("\"2015-11-07T03:49:09Z\"", java.sql.Date.class)));
|
||||
@@ -79,7 +80,7 @@ public class JSONTest {
|
||||
assertEquals(utcDate, json.serialize(date));
|
||||
|
||||
// custom datetime format: without milli-seconds, custom time zone
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT);
|
||||
format.setTimeZone(TimeZone.getTimeZone("GMT+10"));
|
||||
apiClient.setDateFormat(format);
|
||||
|
||||
@@ -190,10 +191,10 @@ public class JSONTest {
|
||||
public static String getCurrentTimezoneOffset() {
|
||||
|
||||
TimeZone tz = TimeZone.getDefault();
|
||||
Calendar cal = GregorianCalendar.getInstance(tz);
|
||||
Calendar cal = GregorianCalendar.getInstance(tz, Locale.ROOT);
|
||||
int offsetInMillis = tz.getOffset(cal.getTimeInMillis());
|
||||
|
||||
String offset = String.format("%02d:%02d", Math.abs(offsetInMillis / 3600000), Math.abs((offsetInMillis / 60000) % 60));
|
||||
String offset = String.format(Locale.ROOT,"%02d:%02d", Math.abs(offsetInMillis / 3600000), Math.abs((offsetInMillis / 60000) % 60));
|
||||
offset = (offsetInMillis >= 0 ? "+" : "-") + offset;
|
||||
|
||||
return offset;
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ApiClientTest {
|
||||
assertEquals(dateStr, apiClient.formatDate(apiClient.parseDate("2015-11-07T02:49:09.356-01:00")));
|
||||
|
||||
// custom date format: without milli-seconds, custom time zone
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX");
|
||||
DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssXXX", Locale.ROOT);
|
||||
format.setTimeZone(TimeZone.getTimeZone("GMT+10"));
|
||||
apiClient.setDateFormat(format);
|
||||
dateStr = "2015-11-07T13:49:09+10:00";
|
||||
|
||||
@@ -14,8 +14,9 @@ COPY ./LICENSE ${GEN_DIR}
|
||||
COPY ./google_checkstyle.xml ${GEN_DIR}
|
||||
|
||||
# Modules are copied individually here to allow for caching of docker layers between major.minor versions
|
||||
# NOTE: openapi-generator-online is not included here
|
||||
COPY ./modules/openapi-generator-gradle-plugin ${GEN_DIR}/modules/openapi-generator-gradle-plugin
|
||||
COPY ./modules/openapi-generator-maven-plugin ${GEN_DIR}/modules/openapi-generator-maven-plugin
|
||||
COPY ./modules/openapi-generator-online ${GEN_DIR}/modules/openapi-generator-online
|
||||
COPY ./modules/openapi-generator-cli ${GEN_DIR}/modules/openapi-generator-cli
|
||||
COPY ./modules/openapi-generator ${GEN_DIR}/modules/openapi-generator
|
||||
COPY ./pom.xml ${GEN_DIR}
|
||||
|
||||
123
README.md
123
README.md
@@ -2,7 +2,7 @@
|
||||
|
||||
<div align="center">
|
||||
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.1.0`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[Master](https://github.com/OpenAPITools/openapi-generator/tree/master) (`3.2.3`): [](https://travis-ci.org/OpenAPITools/openapi-generator)
|
||||
[](https://circleci.com/gh/OpenAPITools/openapi-generator)
|
||||
[](https://app.shippable.com/github/OpenAPITools/openapi-generator)
|
||||
[](https://ci.appveyor.com/project/WilliamCheng/openapi-generator-wh2wu)
|
||||
@@ -16,6 +16,8 @@
|
||||
<div align="center">
|
||||
|
||||
[](https://gitter.im/OpenAPITools/openapi-generator?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
[](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.openapitools%22%20AND%20a%3A%22openapi-generator%22)
|
||||
[](https://twitter.com/oas_generator)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -78,16 +80,18 @@ OpenAPI Generator allows generation of API client libraries (SDK generation), se
|
||||
|
||||
The OpenAPI Specification has undergone 3 revisions since initial creation in 2010. The openapi-generator project has the following compatibilities with the OpenAPI Specification:
|
||||
|
||||
OpenAPI Generator Version | Release Date | OpenAPI Spec compatibility | Notes
|
||||
---------------------------- | ------------ | -------------------------- | -----
|
||||
4.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes (no fallback)
|
||||
3.1.0 (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.1.0-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release with breaking changes (with fallbacks)
|
||||
[3.0.3](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.3) | 27.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
|
||||
[3.0.2](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.2) | 18.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
|
||||
[3.0.1](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.1) | 11.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | Bugfix release
|
||||
[3.0.0](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.0.0) | 01.06.2018 | 1.0, 1.1, 1.2, 2.0, 3.0 | First release with breaking changes
|
||||
OpenAPI Generator Version | Release Date | Notes
|
||||
---------------------------- | ------------ | -----
|
||||
4.0.0 (upcoming major release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/4.0.0-SNAPSHOT/)| TBD | Major release with breaking changes (no fallback)
|
||||
3.3.0 (upcoming minor release)| TBD | Minor release (breaking changes with fallbacks)
|
||||
3.2.3 (current master, upcoming patch release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/org/openapitools/openapi-generator-cli/3.2.3-SNAPSHOT/)| TBD | Bugfix release
|
||||
[3.2.2](https://github.com/OpenAPITools/openapi-generator/releases/tag/v3.2.2) (latest stable release) | 22.08.2018 | Bugfix release
|
||||
|
||||
### [1.2 - Artifacts on Maven Central](#table-of-contents)
|
||||
OpenAPI Spec compatibility: 1.0, 1.1, 1.2, 2.0, 3.0
|
||||
|
||||
For old releases, please refer to the [**Release**](https://github.com/OpenAPITools/openapi-generator/releases) page.
|
||||
|
||||
## [1.2 - Artifacts on Maven Central](#table-of-contents)
|
||||
|
||||
You can find our released artefacts on maven central:
|
||||
|
||||
@@ -120,7 +124,7 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
|
||||
</dependency>
|
||||
```
|
||||
* See the different versions of the [openapi-generator-maven-plugin](https://mvnrepository.com/artifact/org.openapitools/openapi-generator-maven-plugin) artifact available on maven central.
|
||||
* [Readme](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/README.adoc)
|
||||
* [Readme](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/README.md)
|
||||
|
||||
**Gradle plugin:**
|
||||
```xml
|
||||
@@ -137,16 +141,16 @@ See the different versions of the [openapi-generator-cli](https://mvnrepository.
|
||||
|
||||
If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum):
|
||||
|
||||
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.3/openapi-generator-cli-3.0.3.jar`
|
||||
JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.2.2/openapi-generator-cli-3.2.2.jar`
|
||||
|
||||
For **Mac/Linux** users:
|
||||
```sh
|
||||
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.3/openapi-generator-cli-3.0.3.jar -O openapi-generator-cli.jar
|
||||
wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.2.2/openapi-generator-cli-3.2.2.jar -O openapi-generator-cli.jar
|
||||
```
|
||||
|
||||
For **Windows** users, you will need to install [wget](http://gnuwin32.sourceforge.net/packages/wget.htm) or you can use Invoke-WebRequest in PowerShell (3.0+), e.g.
|
||||
```
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.0.3/openapi-generator-cli-3.0.3.jar
|
||||
Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/3.2.2/openapi-generator-cli-3.2.2.jar
|
||||
```
|
||||
|
||||
After downloading the JAR, run `java -jar openapi-generator-cli.jar help` to show the usage.
|
||||
@@ -157,6 +161,49 @@ export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
|
||||
export PATH=${JAVA_HOME}/bin:$PATH
|
||||
```
|
||||
|
||||
### Launcher Script
|
||||
|
||||
One downside to manual jar downloads is that you don't keep up-to-date with the latest released version. We have a Bash launcher script at [bin/utils/openapi-generator.cli.sh](./bin/utils/openapi-generator-cli.sh) which resolves this issue.
|
||||
|
||||
To install the launcher script, copy the contents of the script to a location on your path and make the script executable.
|
||||
|
||||
An example of setting this up (NOTE: Always evaluate scripts curled from external systems before executing them).
|
||||
|
||||
```
|
||||
mkdir -p ~/bin/openapitools
|
||||
curl https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ~/bin/openapitools/openapi-generator-cli
|
||||
chmod u+x ~/bin/openapitools/openapi-generator-cli
|
||||
export PATH=$PATH:~/bin/openapitools/
|
||||
```
|
||||
|
||||
Now, `openapi-generator-cli` is "installed". On invocation, it will query the GitHub repository for the most recently released version. If this matches the last downloaded jar,
|
||||
it will execute as normal. If a newer version is found, the script will download the latest release and execute it.
|
||||
|
||||
If you need to invoke an older version of the generator, you can define the variable `OPENAPI_GENERATOR_VERSION` either ad hoc or globally. You can export this variable if you'd like to persist a specific release version.
|
||||
|
||||
Examples:
|
||||
|
||||
```
|
||||
# Execute latest released openapi-generator-cli
|
||||
openapi-generator-cli version
|
||||
|
||||
# Execute version 3.1.0 for the current invocation, regardless of the latest released version
|
||||
OPENAPI_GENERATOR_VERSION=3.1.0 openapi-generator-cli version
|
||||
|
||||
# Execute version 3.1.0-SNAPSHOT for the current invocation
|
||||
OPENAPI_GENERATOR_VERSION=3.1.0-SNAPSHOT openapi-generator-cli version
|
||||
|
||||
# Execute version 3.0.2 for every invocation in the current shell session
|
||||
export OPENAPI_GENERATOR_VERSION=3.0.2
|
||||
openapi-generator-cli version # is 3.0.2
|
||||
openapi-generator-cli version # is also 3.0.2
|
||||
|
||||
# To "install" a specific version, set the variable in .bashrc/.bash_profile
|
||||
echo "export OPENAPI_GENERATOR_VERSION=3.0.2" >> ~/.bashrc
|
||||
source ~/.bashrc
|
||||
openapi-generator-cli version # is always 3.0.2, unless any of the above overrides are done ad hoc
|
||||
```
|
||||
|
||||
### [1.4 - Build Projects](#table-of-contents)
|
||||
|
||||
To build from source, you need the following installed and available in your `$PATH:`
|
||||
@@ -193,22 +240,6 @@ To reinstall with the latest master, run `brew reinstall --HEAD openapi-generato
|
||||
- [https://hub.docker.com/r/openapitools/openapi-generator-cli/](https://hub.docker.com/r/openapitools/openapi-generator-cli/) (official CLI)
|
||||
- [https://hub.docker.com/r/openapitools/openapi-generator-online/](https://hub.docker.com/r/openapitools/openapi-generator-online/) (official web service)
|
||||
|
||||
#### Docker tags
|
||||
|
||||
`lastest` Tag contains the continuously built version from our `master` branch.
|
||||
|
||||
`v0.0.0` Tags correspond to a released version in this git repository. Examples:
|
||||
|
||||
* `v3.0.0` Tag
|
||||
* `v3.0.1` Tag
|
||||
* `v3.0.2` Tag
|
||||
|
||||
`0.0.x` Tags correspond to continuously built versions (after each commit), regardless of the branch it is built from. Examples:
|
||||
|
||||
* `3.0.x` Tag: contains first `3.0.2-SNAPSHOT` and after the `3.0.2` release it contains `3.0.3-SNAPSHOT` and so on.
|
||||
* `3.1.x` Tag: contains first `3.1.0-SNAPSHOT` and after the `3.1.0` release it contains `3.1.1-SNAPSHOT` and so on.
|
||||
* `4.0.x` Tag: contains first `4.0.0-SNAPSHOT` and after the `4.0.0` release it contains `4.0.1-SNAPSHOT` and so on.
|
||||
|
||||
|
||||
#### OpenAPI Generator CLI Docker Image
|
||||
|
||||
@@ -285,6 +316,20 @@ Once built, `run-in-docker.sh` will act as an executable for openapi-generator-c
|
||||
-g go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore
|
||||
```
|
||||
|
||||
##### Troubleshooting
|
||||
|
||||
If an error like this occurs, just execute the **mvn clean install -U** command:
|
||||
|
||||
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project openapi-generator: A type incompatibility occurred while executing org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test: java.lang.ExceptionInInitializerError cannot be cast to java.io.IOException
|
||||
|
||||
```sh
|
||||
./run-in-docker.sh mvn clean install -U
|
||||
```
|
||||
|
||||
> Failed to execute goal org.fortasoft:gradle-maven-plugin:1.0.8:invoke (default) on project openapi-generator-gradle-plugin-mvn-wrapper: org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.7-bin.zip'
|
||||
|
||||
Right now: no solution for this one :|
|
||||
|
||||
#### Run Docker in Vagrant
|
||||
Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads).
|
||||
```sh
|
||||
@@ -361,13 +406,14 @@ SYNOPSIS
|
||||
[--invoker-package <invoker package>]
|
||||
[(-l <language> | --lang <language>)]
|
||||
[--language-specific-primitives <language specific primitives>...]
|
||||
[--library <library>] [--model-name-prefix <model name prefix>]
|
||||
[--library <library>] [--log-to-stderr]
|
||||
[--model-name-prefix <model name prefix>]
|
||||
[--model-name-suffix <model name suffix>]
|
||||
[--model-package <model package>]
|
||||
[(-o <output directory> | --output <output directory>)]
|
||||
[--release-note <release note>] [--remove-operation-id-prefix]
|
||||
[--reserved-words-mappings <reserved word mappings>...]
|
||||
[(-s | --skip-overwrite)]
|
||||
[(-s | --skip-overwrite)] [--skip-validate-spec]
|
||||
[(-t <template directory> | --template-dir <template directory>)]
|
||||
[--type-mappings <type mappings>...] [(-v | --verbose)]
|
||||
|
||||
@@ -425,20 +471,21 @@ Here are some companies/projects (alphabetical order) using OpenAPI Generator in
|
||||
- [Bithost GmbH](https://www.bithost.ch)
|
||||
- [GMO Pepabo](https://pepabo.com/en/)
|
||||
- [Raiffeisen Schweiz Genossenschaft](https://www.raiffeisen.ch)
|
||||
- [RepreZen API Studio](https://www.reprezen.com/swagger-openapi-code-generation-api-first-microservices-enterprise-development)
|
||||
- [REST United](https://restunited.com)
|
||||
- [Suva](https://www.suva.ch/)
|
||||
- [Telstra](https://dev.telstra.com)
|
||||
- [unblu inc.](https://www.unblu.com/)
|
||||
|
||||
|
||||
## [5 - Presentations/Videos/Tutorials/Books](#table-of-contents)
|
||||
|
||||
- 2018/04/12 - [Generate Angular API clients with Swagger](https://angular.schule/blog/2018-04-swagger-codegen) by [JohannesHoppe](https://github.com/JohannesHoppe)
|
||||
- 2018/05/12 - [OpenAPI Generator - community drivenで成長するコードジェネレータ](https://ackintosh.github.io/blog/2018/05/12/openapi-generator/) by [中野暁人](https://github.com/ackintosh)
|
||||
- 2018/05/15 - [Starting a new open-source project](http://jmini.github.io/blog/2018/2018-05-15_new-open-source-project.html) by [Jeremie Bresson](https://github.com/jmini)
|
||||
- 2018/05/15 - [REST API仕様からAPIクライアントやスタブサーバを自動生成する「OpenAPI Generator」オープンソースで公開。Swagger Codegenからのフォーク](https://www.publickey1.jp/blog/18/rest_apiapiopenapi_generatorswagger_generator.html) by [Publickey](https://www.publickey1.jp)
|
||||
- 2018/06/08 - [Swagger Codegen is now OpenAPI Generator](https://angular.schule/blog/2018-06-swagger-codegen-is-now-openapi-generator) by [JohannesHoppe](https://github.com/JohannesHoppe)
|
||||
- 2018/06/21 - [Connect your JHipster apps to the world of APIs with OpenAPI and gRPC](https://fr.slideshare.net/chbornet/jhipster-conf-2018-connect-your-jhipster-apps-to-the-world-of-apis-with-openapi-and-grpc) by [Christophe Bornet](https://github.com/cbornet) at [JHipster Conf 2018](https://jhipster-conf.github.io/)
|
||||
- 2018/06/27 - [Lessons Learned from Leading an Open-Source Project Supporting 30+ Programming Languages](https://speakerdeck.com/wing328/lessons-learned-from-leading-an-open-source-project-supporting-30-plus-programming-languages) - [William Cheng](https://github.com/wing328) at [LinuxCon + ContainerCon + CloudOpen China 2018](https://www.lfasiallc.com/events/lc3-2018/)
|
||||
- 2018/06/27 - [Lessons Learned from Leading an Open-Source Project Supporting 30+ Programming Languages](https://speakerdeck.com/wing328/lessons-learned-from-leading-an-open-source-project-supporting-30-plus-programming-languages) - [William Cheng](https://github.com/wing328) at [LinuxCon + ContainerCon + CloudOpen China 2018](http://bit.ly/2waDKKX)
|
||||
- 2018/07/19 - [OpenAPI Generator Contribution Quickstart - RingCentral Go SDK](https://medium.com/ringcentral-developers/openapi-generator-for-go-contribution-quickstart-8cc72bf37b53) by [John Wang](https://github.com/grokify)
|
||||
|
||||
## [6 - About Us](#table-of-contents)
|
||||
|
||||
@@ -513,6 +560,7 @@ Here is a list of template creators:
|
||||
* Ada: @stcarrez
|
||||
* C# ASP.NET5: @jimschubert
|
||||
* C# NancyFX: @mstefaniuk
|
||||
* C++ (Qt5 QHttpEngine): @etherealjoy
|
||||
* C++ Pistache: @sebymiano
|
||||
* C++ Restbed: @stkrwork
|
||||
* Erlang Server: @galaxie
|
||||
@@ -528,6 +576,7 @@ Here is a list of template creators:
|
||||
* JAX-RS CXF (CDI): @nickcmaynard
|
||||
* JAX-RS RestEasy (JBoss EAP): @jfiala
|
||||
* Kotlin: @jimschubert
|
||||
* PHP Laravel: @renepardon
|
||||
* PHP Lumen: @abcsun
|
||||
* PHP Slim: @jfastnacht
|
||||
* PHP Symfony: @ksm2
|
||||
@@ -586,7 +635,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| Elixir | |
|
||||
| Elm | |
|
||||
| Erlang | @tsloughter (2017/11) |
|
||||
| Go | @antihax (2017/11) @bvwells (2017/12) |
|
||||
| Go | @antihax (2017/11) @bvwells (2017/12) @grokify (2018/07) |
|
||||
| Groovy | |
|
||||
| Haskell | |
|
||||
| Java | @bbdouglas (2017/07) @JFCote (2017/08) @sreeshas (2017/08) @jfiala (2017/08) @lukoyanov (2017/09) @cbornet (2017/09) @jeff9finger (2018/01) |
|
||||
@@ -595,7 +644,7 @@ If you want to join the committee, please kindly apply by sending an email to te
|
||||
| NodeJS/Javascript | @CodeNinjai (2017/07) @frol (2017/07) @cliffano (2017/07) |
|
||||
| ObjC | |
|
||||
| Perl | @wing328 (2017/07) |
|
||||
| PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) @ackintosh (2017/09) |
|
||||
| PHP | @jebentier (2017/07) @dkarlovi (2017/07) @mandrean (2017/08) @jfastnacht (2017/09) @ackintosh (2017/09) @ybelenko (2018/07) |
|
||||
| PowerShell | |
|
||||
| Python | @taxpon (2017/07) @frol (2017/07) @mbohlool (2017/07) @cbornet (2017/09) @kenjones-cisco (2017/11)|
|
||||
| R | |
|
||||
|
||||
@@ -18,6 +18,7 @@ install:
|
||||
- cmd: SET MAVEN_OPTS=-XX:MaxPermSize=2g -Xmx4g
|
||||
- cmd: SET JAVA_OPTS=-XX:MaxPermSize=2g -Xmx4g
|
||||
- cmd: SET M2_HOME=C:\maven\apache-maven-3.2.5
|
||||
- cmd: java -version
|
||||
- cmd: dir/w
|
||||
- git clone https://github.com/wing328/swagger-samples
|
||||
- ps: Start-Process -FilePath 'C:\maven\apache-maven-3.2.5\bin\mvn' -ArgumentList 'jetty:run' -WorkingDirectory "$env:appveyor_build_folder\swagger-samples\java\java-jersey-jaxrs-ci"
|
||||
@@ -34,6 +35,8 @@ build_script:
|
||||
# install openapi-generator locally
|
||||
- mvn clean install --quiet
|
||||
test_script:
|
||||
# restore test-related files
|
||||
- copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj
|
||||
# test c# API client
|
||||
- nunit-console samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\bin\Debug\Org.OpenAPITools.Test.dll --result=myresults.xml;format=AppVeyor
|
||||
# test c# API client (with PropertyChanged)
|
||||
@@ -41,6 +44,10 @@ test_script:
|
||||
|
||||
# generate all petstore clients
|
||||
- .\bin\windows\run-all-petstore.cmd
|
||||
|
||||
# generate all petstore clients (openapi3)
|
||||
- .\bin\openapi3\windows\run-all-petstore.cmd
|
||||
|
||||
cache:
|
||||
- C:\maven\
|
||||
- C:\Users\appveyor\.m2
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -g cpp-pistache-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/cpp-pistache $@"
|
||||
ags="generate -g cpp-pistache-server -t modules/openapi-generator/src/main/resources/cpp-pistache-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml --additional-properties addExternalLibs=true -o samples/server/petstore/cpp-pistache $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
32
bin/cpp-qt5-qhttpengine-server-petstore.sh
Executable file
32
bin/cpp-qt5-qhttpengine-server-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g cpp-qt5-qhttpengine-server -o samples/server/petstore/cpp-qt5-qhttpengine-server $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -29,8 +29,9 @@ fi
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
# restore csproj file
|
||||
echo "restore csproject file: CI/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj"
|
||||
cp ./CI/samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj ./samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/
|
||||
cp ./CI/samples.ci/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj ./samples/client/petstore/csharp/OpenAPIClient/src/Org.OpenAPITools.Test/
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dynamic-html -o samples/dynamic-html $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dynamic-html -o samples/documentation/dynamic-html $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g elm -o samples/client/petstore/elm $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g elm -t modules/openapi-generator/src/main/resources/elm -o samples/client/petstore/elm $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -25,8 +25,11 @@ then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/go/go-petstore-withXml"
|
||||
rm -rf samples/client/petstore/go/go-petstore-withXml
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/go -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g go -o samples/client/petstore/go/go-petstore-withXml -DpackageName=petstore,withXml=true $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/go -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g go -o samples/client/petstore/go/go-petstore-withXml -DpackageName=petstore,withXml=true,withGoCodegenComment=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -25,6 +25,9 @@ then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/go/go-petstore"
|
||||
rm -rf samples/client/petstore/go/go-petstore
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/go -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g go -o samples/client/petstore/go/go-petstore -DpackageName=petstore $@"
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/markdown.yaml -g html -o samples/html.md $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/markdown.yaml -g html -o samples/documentation/html.md $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html -o samples/html $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html -o samples/documentation/html $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html2 -o samples/html2 --additional-properties hideGenerationTimestamp=true $@"
|
||||
ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g html2 -o samples/documentation/html2 --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,7 +27,7 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate --artifact-id petstore-java-client-jersey1 -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples/client/petstore/java/jersey1 -DhideGenerationTimestamp=true --library=jersey1 $@"
|
||||
ags="generate --artifact-id petstore-java-client-jersey1 -t modules/openapi-generator/src/main/resources/Java -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g java -o samples/client/petstore/java/jersey1 -DhideGenerationTimestamp=true --library=jersey1 --additional-properties useNullForUnknownEnumValue=true $@"
|
||||
|
||||
echo "Removing files and folders under samples/client/petstore/java/jersey1/src/main"
|
||||
rm -rf samples/client/petstore/java/jersey1/src/main
|
||||
|
||||
@@ -32,4 +32,8 @@ ags="generate --artifact-id petstore-jersey2-java6 -i modules/openapi-generator/
|
||||
echo "Removing files and folders under samples/client/petstore/java/jersey2-java6/src/main"
|
||||
rm -rf samples/client/petstore/java/jersey2-java6/src/main
|
||||
find samples/client/petstore/java/jersey2-java6 -maxdepth 1 -type f ! -name "README.md" -exec rm {} +
|
||||
|
||||
echo "Restoring build.gradle ... "
|
||||
cp CI/samples.ci/client/petstore/java/jersey2-java6/build.gradle samples/client/petstore/java/jersey2-java6/
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
{
|
||||
"library": "jersey2",
|
||||
"artifactId": "petstore-jersey2"
|
||||
"artifactId": "petstore-jersey2",
|
||||
"additionalProperties" : {
|
||||
"useNullForUnknownEnumValue" : true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -g cpp-pistache-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o samples/server/petstore/cpp-pistache $@"
|
||||
ags="generate -g cpp-pistache-server -t modules/openapi-generator/src/main/resources/cpp-pistache-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -o samples/server/petstore/cpp-pistache $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/rails5 -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/rails5 $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/cpp-qt5-qhttpengine-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g cpp-qt5-qhttpengine-server -o samples/client/petstore/cpp-qt5-qhttpengine-server $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate $@ -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C}"
|
||||
ags="generate $@ -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/openapi3/client/petstore/csharp/OpenAPIClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C}"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
32
bin/openapi3/jaxrs-jersey-petstore.sh
Normal file
32
bin/openapi3/jaxrs-jersey-petstore.sh
Normal file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate --artifact-id "openapiv3-jaxrs-jersey-petstore-server" -t modules/openapi-generator/src/main/resources/JavaJaxRS/ -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g jaxrs-jersey -o samples/server/petstore/jaxrs-jersey $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
42
bin/openapi3/php-laravel-petstore.sh
Executable file
42
bin/openapi3/php-laravel-petstore.sh
Executable file
@@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
# Make sure that the working directory is the root dir
|
||||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd "${SCRIPT_DIR}/../"
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
# Make sure that we are regenerating the sample by removing any existing target directory
|
||||
TARGET_DIR="$SCRIPT_DIR/../../samples/server/petstore/php-laravel"
|
||||
if [ -d "$TARGET_DIR" ]; then
|
||||
rm -rf $TARGET_DIR
|
||||
fi
|
||||
|
||||
executable="$SCRIPT_DIR/../../modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t $SCRIPT_DIR/../../modules/openapi-generator/src/main/resources/php-laravel -i $SCRIPT_DIR/../../modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-laravel -o $TARGET_DIR $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -33,6 +33,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/php -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php -o samples/openapi3/client/petstore/php $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/php -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php -o samples/openapi3/client/petstore/php/OpenAPIClient-php $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/php-silex -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-silex -o samples/server/petstore/php-silex $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/php-silex -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g php-silex -o samples/server/petstore/php-silex/OpenAPIServer $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -23,7 +23,7 @@ if [ ! -d "${APP_DIR}" ]; then
|
||||
fi
|
||||
|
||||
# Make sure that we are regenerating the sample by removing any existing target directory
|
||||
TARGET_DIR="$SCRIPT_DIR/../../samples/server/petstore/php-symfony"
|
||||
TARGET_DIR="$SCRIPT_DIR/../../samples/server/petstore/php-symfony/SymfonyBundle-php"
|
||||
if [ -d "$TARGET_DIR" ]; then
|
||||
rm -rf $TARGET_DIR
|
||||
fi
|
||||
|
||||
32
bin/openapi3/ruby-client-petstore.sh
Executable file
32
bin/openapi3/ruby-client-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore-security-test/ruby $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
33
bin/openapi3/run-all-petstore
Executable file
33
bin/openapi3/run-all-petstore
Executable file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
# this bash script will loop through all the .sh files under bin
|
||||
# execute the script and check the result (exit code) to see if
|
||||
# there's any error
|
||||
|
||||
echo "IMPORTANT: this script should be run by the CI (e.g. Shippable) only. There's no need to run this script to update Petstore samples for all generators."
|
||||
echo "Please press CTRL+C to stop or the script will continue in 10 seconds."
|
||||
|
||||
sleep 10
|
||||
|
||||
successes=0
|
||||
failures=0
|
||||
for SCRIPT in $(ls -l ./bin/openapi3/*.sh | grep -v all)
|
||||
do
|
||||
if [ -f ${SCRIPT} -a -x ${SCRIPT} ]; then
|
||||
echo "Running $SCRIPT (output to /dev/null)"
|
||||
${SCRIPT} 2>&1 > /dev/null
|
||||
rc=$?
|
||||
if [[ ${rc} != 0 ]]; then
|
||||
>&2 echo "ERROR!! FAILED TO RUN ${SCRIPT}"
|
||||
((failures+=1))
|
||||
else
|
||||
((successes+=1))
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if (( failures > 0 )); then
|
||||
>&2 echo "[ERROR] ${failures} out of $((failures+successes)) scripts failed."
|
||||
exit 1
|
||||
else
|
||||
echo "[SUCCESS] ${successes} generators finished."
|
||||
fi
|
||||
14
bin/openapi3/windows/csharp-petstore.bat
Executable file
14
bin/openapi3/windows/csharp-petstore.bat
Executable file
@@ -0,0 +1,14 @@
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test/resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\openapi3\client\petstore\csharp\SwaggerClient --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C}
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
REM restore csproj file
|
||||
echo "restore csproject file: CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj"
|
||||
copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\openapi3\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\
|
||||
15
bin/openapi3/windows/run-all-petstore.cmd
Normal file
15
bin/openapi3/windows/run-all-petstore.cmd
Normal file
@@ -0,0 +1,15 @@
|
||||
REM this batch file will loop through all the .bat files under bin\openapi3\windows\
|
||||
REM execute the script and check the error level to see if there's any error
|
||||
|
||||
echo IMPORTANT: this script should be run by the CI (e.g. appveyor) only. There's no need to run this script to update Petstore samples for all generators.
|
||||
echo Please press CTRL+C to stop or the script will continue in 10 seconds.
|
||||
|
||||
timeout 10
|
||||
|
||||
for /f "delims=" %%i in ('dir /b ".\bin\openapi3\windows\*.bat"') do (
|
||||
|
||||
CALL .\bin\openapi3\windows\%%i
|
||||
|
||||
IF ERRORLEVEL 1 IF NOT ERRORLEVEL 2 exit /b 1
|
||||
|
||||
)
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/sinatra -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/sinatra $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/php-laravel -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php-laravel -o samples/server/petstore/php-laravel $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -33,6 +33,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/php -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php -o samples/client/petstore/php $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/php -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g php -o samples/client/petstore/php/OpenAPIClient-php $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/php-silex -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php-silex -o samples/server/petstore/php-silex $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/php-silex -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g php-silex -o samples/server/petstore/php-silex/OpenAPIServer $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -23,7 +23,7 @@ if [ ! -d "${APP_DIR}" ]; then
|
||||
fi
|
||||
|
||||
# Make sure that we are regenerating the sample by removing any existing target directory
|
||||
TARGET_DIR="$SCRIPT_DIR/../samples/server/petstore/php-symfony"
|
||||
TARGET_DIR="$SCRIPT_DIR/../samples/server/petstore/php-symfony/SymfonyBundle-php"
|
||||
if [ -d "$TARGET_DIR" ]; then
|
||||
rm -rf $TARGET_DIR
|
||||
fi
|
||||
|
||||
6
bin/python-petstore-all.sh
Executable file
6
bin/python-petstore-all.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
# update python petstore clients
|
||||
|
||||
./bin/python-asyncio-petstore.sh
|
||||
./bin/python-petstore.sh
|
||||
./bin/python-tornado-petstore.sh
|
||||
32
bin/ruby-client-petstore.sh
Executable file
32
bin/ruby-client-petstore.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=`ls -ld "$SCRIPT"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=`dirname "$SCRIPT"`/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=`dirname "$SCRIPT"`/..
|
||||
APP_DIR=`cd "${APP_DIR}"; pwd`
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore/ruby $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-on-rails-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/ruby-on-rails $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/rails5 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-on-rails -o samples/server/petstore/rails5 $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-sinatra-server -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/ruby-sinatra $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -13,8 +13,8 @@ failures=0
|
||||
for SCRIPT in $(ls -l ./bin/*.sh | grep -v all)
|
||||
do
|
||||
if [ -f ${SCRIPT} -a -x ${SCRIPT} ]; then
|
||||
echo "Running $SCRIPT"
|
||||
${SCRIPT}
|
||||
echo "Running $SCRIPT (output to /dev/null)"
|
||||
${SCRIPT} 2>&1 > /dev/null
|
||||
rc=$?
|
||||
if [[ ${rc} != 0 ]]; then
|
||||
>&2 echo "ERROR!! FAILED TO RUN ${SCRIPT}"
|
||||
@@ -30,4 +30,4 @@ if (( failures > 0 )); then
|
||||
exit 1
|
||||
else
|
||||
echo "[SUCCESS] ${successes} generators finished."
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -25,8 +25,10 @@ then
|
||||
mvn -B clean package
|
||||
fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/rust-server -i modules/openapi-generator/src/test/resources/2_0/rust-server/petstore-with-fake-endpoints-models-for-testing.yaml -g rust-server -o samples/server/petstore/rust-server -DpackageName=petstore_api --additional-properties hideGenerationTimestamp=true $@"
|
||||
for spec_path in modules/openapi-generator/src/test/resources/2_0/rust-server/* ; do
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
spec=$(basename "$spec_path" | sed 's/.yaml//')
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/rust-server -i $spec_path -g rust-server -o samples/server/petstore/rust-server/output/$spec -DpackageName=$spec --additional-properties hideGenerationTimestamp=true $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
done
|
||||
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/sinatra -i modules/openapi-generator/src/test/resources/3_0/petstore.yaml -g ruby-sinatra -o samples/server/petstore/sinatra $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/ruby-client -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g ruby -c bin/ruby-petstore.json -o samples/client/petstore-security-test/ruby $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
@@ -27,6 +27,6 @@ fi
|
||||
|
||||
# if you've executed sbt assembly previously it will use that instead.
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/php-silex -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g php-silex -o samples/server/petstore-security-test/silex $@"
|
||||
ags="generate -t modules/openapi-generator/src/main/resources/php-silex -i modules/openapi-generator/src/test/resources/2_0/petstore-security-test.yaml -g php-silex -o samples/server/petstore-security-test/silex/SwaggerServer $@"
|
||||
|
||||
java $JAVA_OPTS -jar $executable $ags
|
||||
|
||||
@@ -10,21 +10,28 @@ echo "Please press CTRL+C to stop or the script will continue in 5 seconds."
|
||||
sleep 5
|
||||
|
||||
# LIST OF SCRIPTS:
|
||||
./bin/ruby-petstore.sh > /dev/null 2>&1
|
||||
./bin/ruby-client-petstore.sh > /dev/null 2>&1
|
||||
./bin/java-petstore-all.sh > /dev/null 2>&1
|
||||
./bin/java-jaxrs-petstore-server-all.sh > /dev/null 2>&1
|
||||
./bin/spring-all-pestore.sh > /dev/null 2>&1
|
||||
./bin/kotlin-client-petstore.sh > /dev/null 2>&1
|
||||
./bin/kotlin-client-string.sh > /dev/null 2>&1
|
||||
./bin/kotlin-client-threetenbp.sh > /dev/null 2>&1
|
||||
./bin/kotlin-server-petstore.shl> /dev/null 2>&1
|
||||
./bin/kotlin-server-petstore.sh > /dev/null 2>&1
|
||||
./bin/php-petstore.sh > /dev/null 2>&1
|
||||
./bin/php-silex-petstore-server.shj> /dev/null 2>&1
|
||||
./bin/php-silex-petstore-server.sh > /dev/null 2>&1
|
||||
./bin/php-symfony-petstore.sh > /dev/null 2>&1
|
||||
./bin/php-lumen-petstore-server.sh > /dev/null 2>&1
|
||||
./bin/php-slim-petstore-server.sh > /dev/null 2>&1
|
||||
./bin/php-slim-server-petstore.sh > /dev/null 2>&1
|
||||
./bin/php-ze-ph-petstore-server.sh > /dev/null 2>&1
|
||||
./bin/openapi3/php-petstore.sh > /dev/null 2>&1
|
||||
./bin/typescript-angular-petstore-all.sh > /dev/null 2>&1
|
||||
./bin/typescript-fetch-petstore-all.sh > /dev/null 2>&1
|
||||
./bin/typescript-node-petstore-all.sh > /dev/null 2>&1
|
||||
./bin/typescript-inversify-petstore.sh > /dev/null 2>&1
|
||||
./bin/rust-server-petstore.sh > /dev/null 2>&1
|
||||
./bin/openapi3/haskell-http-client-petstore.sh > /dev/null 2>&1
|
||||
./bin/csharp-petstore.sh > /dev/null 2>&1
|
||||
|
||||
# Check:
|
||||
if [ -n "$(git status --porcelain)" ]; then
|
||||
|
||||
60
bin/utils/openapi-generator-cli.sh
Normal file
60
bin/utils/openapi-generator-cli.sh
Normal file
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env bash
|
||||
####
|
||||
# Save as openapi-generator-cli on your PATH. chmod u+x. Enjoy.
|
||||
#
|
||||
# This script will query github on every invocation to pull the latest released version
|
||||
# of openapi-generator.
|
||||
#
|
||||
# If you want repeatable executions, you can explicitly set a version via
|
||||
# OPENAPI_GENERATOR_VERSION
|
||||
# e.g. (in Bash)
|
||||
# export OPENAPI_GENERATOR_VERSION=3.1.0
|
||||
# openapi-generator-cli.sh
|
||||
# or
|
||||
# OPENAPI_GENERATOR_VERSION=3.1.0 openapi-generator-cli.sh
|
||||
#
|
||||
# This is also helpful, for example, if you want want to evaluate a SNAPSHOT version.
|
||||
#
|
||||
# NOTE: Jars are downloaded on demand from maven into the same directory as this script
|
||||
# for every 'latest' version pulled from github. Consider putting this under its own directory.
|
||||
####
|
||||
set -o pipefail
|
||||
|
||||
for cmd in {mvn,python,curl}; do
|
||||
if ! command -v ${cmd} > /dev/null; then
|
||||
>&2 echo "This script requires '${cmd}' to be installed."
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
function latest.tag {
|
||||
local uri="https://api.github.com/repos/${1}/tags"
|
||||
curl -s ${uri} | python -c "import sys, json; print json.load(sys.stdin)[0]['name'][1:]"
|
||||
}
|
||||
|
||||
ghrepo=openapitools/openapi-generator
|
||||
groupid=org.openapitools
|
||||
artifactid=openapi-generator-cli
|
||||
ver=${OPENAPI_GENERATOR_VERSION:-$(latest.tag $ghrepo)}
|
||||
|
||||
jar=${artifactid}-${ver}.jar
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [ ! -f ${DIR}/${jar} ]; then
|
||||
repo="central::default::https://repo1.maven.apache.org/maven2"
|
||||
if [[ ${ver} =~ ^.*-SNAPSHOT$ ]]; then
|
||||
repo="central::default::https://oss.sonatype.org/content/repositories/snapshots"
|
||||
fi
|
||||
mvn org.apache.maven.plugins:maven-dependency-plugin:2.9:get \
|
||||
-DremoteRepositories=${repo} \
|
||||
-Dartifact=${groupid}:${artifactid}:${ver} \
|
||||
-Dtransitive=false \
|
||||
-Ddest=${DIR}/${jar}
|
||||
fi
|
||||
|
||||
java -ea \
|
||||
${JAVA_OPTS} \
|
||||
-Xms512M \
|
||||
-Xmx1024M \
|
||||
-server \
|
||||
-jar ${DIR}/${jar} "$@"
|
||||
196
bin/utils/release_checkout.rb
Executable file
196
bin/utils/release_checkout.rb
Executable file
@@ -0,0 +1,196 @@
|
||||
#release_chekcout.rb
|
||||
require 'rubygems'
|
||||
require 'open-uri'
|
||||
require 'net/http'
|
||||
|
||||
def check_homebrew
|
||||
print "Checking homebrew forumla ... "
|
||||
|
||||
url = "https://raw.githubusercontent.com/Homebrew/homebrew-core/master/Formula/openapi-generator.rb"
|
||||
new_maven_url = "https://search.maven.org/remotecontent?filepath=org/openapitools/openapi-generator-cli/#{$version}/openapi-generator-cli-#{$version}.jar"
|
||||
open(url) do |f|
|
||||
content = f.read
|
||||
if !content.nil? && content.include?(new_maven_url)
|
||||
puts "[OK]"
|
||||
else
|
||||
puts "[ERROR]"
|
||||
puts "> #{url} not yet updated with #{new_maven_url}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def check_openapi_generator_online_docker
|
||||
print "Checking openapi-generator-online docker ... "
|
||||
|
||||
url = "https://hub.docker.com/r/openapitools/openapi-generator-online/tags/"
|
||||
docker_tag = "v#{$version}"
|
||||
open(url) do |f|
|
||||
content = f.read
|
||||
if !content.nil? && content.include?(docker_tag)
|
||||
puts "[OK]"
|
||||
else
|
||||
puts "[ERROR]"
|
||||
puts "> #{url} does not have tag #{docker_tag}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def check_openapi_generator_cli_docker
|
||||
print "Checking openapi-generator-cli docker ... "
|
||||
|
||||
url = "https://hub.docker.com/r/openapitools/openapi-generator-cli/tags/"
|
||||
docker_tag = "v#{$version}"
|
||||
open(url) do |f|
|
||||
content = f.read
|
||||
if !content.nil? && content.include?(docker_tag)
|
||||
puts "[OK]"
|
||||
else
|
||||
puts "[ERROR]"
|
||||
puts "> #{url} does not have tag #{docker_tag}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def check_readme
|
||||
print "Checking openapi-generator README.md ... "
|
||||
|
||||
url = "https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/README.md"
|
||||
matches = ["[#{$version}](https://github.com/OpenAPITools/openapi-generator/releases/tag/v#{$version})",
|
||||
"JAR location: `http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/#{$version}/openapi-generator-cli-#{$version}.jar`",
|
||||
"wget http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/#{$version}/openapi-generator-cli-#{$version}.jar -O openapi-generator-cli.jar",
|
||||
"Invoke-WebRequest -OutFile openapi-generator-cli.jar http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/#{$version}/openapi-generator-cli-#{$version}.jar"]
|
||||
open(url) do |f|
|
||||
content = f.read
|
||||
has_outdated = false
|
||||
not_matched = []
|
||||
matches.each do |match|
|
||||
if !content.nil? && content.include?(match)
|
||||
# matched
|
||||
else
|
||||
has_outdated = true
|
||||
not_matched << match
|
||||
end
|
||||
end
|
||||
|
||||
if has_outdated
|
||||
puts "[ERROR]"
|
||||
not_matched.each do |str|
|
||||
puts "> '#{str}' not found in README.md"
|
||||
end
|
||||
else
|
||||
puts "[OK]"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def check_openapi_generator_jar
|
||||
print "Checking openapi-generator JAR ... "
|
||||
url = "http://central.maven.org/maven2/org/openapitools/openapi-generator/#{$version}/openapi-generator-#{$version}.jar"
|
||||
|
||||
if check_url(url)
|
||||
puts "[OK]"
|
||||
else
|
||||
puts "[ERROR]"
|
||||
puts "> #{url} not found"
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
def check_openapi_generator_cli_jar
|
||||
print "Checking openapi-generator-cli JAR ... "
|
||||
url = "http://central.maven.org/maven2/org/openapitools/openapi-generator-cli/#{$version}/openapi-generator-cli-#{$version}.jar"
|
||||
|
||||
if check_url(url)
|
||||
puts "[OK]"
|
||||
else
|
||||
puts "[ERROR]"
|
||||
puts "> #{url} not found"
|
||||
end
|
||||
end
|
||||
|
||||
def check_openapi_generator_maven_plugin_jar
|
||||
print "Checking openapi-generator-maven-plugin JAR ... "
|
||||
url = "http://central.maven.org/maven2/org/openapitools/openapi-generator-maven-plugin/#{$version}/openapi-generator-maven-plugin-#{$version}.jar"
|
||||
|
||||
if check_url(url)
|
||||
puts "[OK]"
|
||||
else
|
||||
puts "[ERROR]"
|
||||
puts "> #{url} not found"
|
||||
end
|
||||
end
|
||||
|
||||
def check_openapi_generator_gradle_plugin_jar
|
||||
print "Checking openapi-generator-gradle-plugin JAR ... "
|
||||
url = "http://central.maven.org/maven2/org/openapitools/openapi-generator-gradle-plugin/#{$version}/openapi-generator-gradle-plugin-#{$version}.jar"
|
||||
|
||||
if check_url(url)
|
||||
puts "[OK]"
|
||||
else
|
||||
puts "[ERROR]"
|
||||
puts "> #{url} not found"
|
||||
end
|
||||
end
|
||||
|
||||
def check_openapi_generator_online_jar
|
||||
print "Checking openapi-generator-online JAR ... "
|
||||
url = "http://central.maven.org/maven2/org/openapitools/openapi-generator-online/#{$version}/openapi-generator-online-#{$version}.jar"
|
||||
|
||||
if check_url(url)
|
||||
puts "[OK]"
|
||||
else
|
||||
puts "[ERROR]"
|
||||
puts "> #{url} not found"
|
||||
end
|
||||
end
|
||||
|
||||
def check_openapi_generator_project_pom
|
||||
print "Checking openapi-generator-project pom.xml ... "
|
||||
url = "http://central.maven.org/maven2/org/openapitools/openapi-generator-project/#{$version}/openapi-generator-project-#{$version}.pom"
|
||||
|
||||
if check_url(url)
|
||||
puts "[OK]"
|
||||
else
|
||||
puts "[ERROR]"
|
||||
puts "> #{url} not found"
|
||||
end
|
||||
end
|
||||
|
||||
def check_url url
|
||||
content = Net::HTTP.get(URI.parse(url))
|
||||
url = URI.parse(url)
|
||||
req = Net::HTTP.new(url.host, url.port)
|
||||
res = req.request_head(url.path)
|
||||
if res.code == "200"
|
||||
true
|
||||
else
|
||||
false
|
||||
end
|
||||
end
|
||||
|
||||
def usage
|
||||
puts "ERROR!! Version (e.g. 3.0.2) missing"
|
||||
puts "Usage example: ruby #{$0} 3.0.2"
|
||||
end
|
||||
|
||||
|
||||
if (!ARGV[0])
|
||||
usage
|
||||
exit
|
||||
end
|
||||
|
||||
$version = ARGV[0]
|
||||
|
||||
puts "Running checkout on OpenAPI Generator release #{$version}"
|
||||
|
||||
check_homebrew
|
||||
check_openapi_generator_jar
|
||||
check_openapi_generator_cli_jar
|
||||
check_openapi_generator_maven_plugin_jar
|
||||
check_openapi_generator_gradle_plugin_jar
|
||||
check_openapi_generator_online_jar
|
||||
check_openapi_generator_project_pom
|
||||
check_readme
|
||||
check_openapi_generator_online_docker
|
||||
check_openapi_generator_cli_docker
|
||||
@@ -40,16 +40,13 @@ declare -a files=("CI/pom.xml.bash"
|
||||
"CI/pom.xml.circleci.java7"
|
||||
"CI/pom.xml.ios"
|
||||
"modules/openapi-generator-cli/pom.xml"
|
||||
"modules/openapi-generator-gradle-plugin/README.adoc"
|
||||
"modules/openapi-generator-gradle-plugin/gradle.properties"
|
||||
"modules/openapi-generator-gradle-plugin/pom.xml"
|
||||
"modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle"
|
||||
"modules/openapi-generator-maven-plugin/pom.xml"
|
||||
"modules/openapi-generator-online/pom.xml"
|
||||
"modules/openapi-generator/pom.xml"
|
||||
"modules/openapi-generator-online/Dockerfile"
|
||||
"pom.xml"
|
||||
"README.md")
|
||||
"pom.xml")
|
||||
|
||||
for filename in "${files[@]}"; do
|
||||
# e.g. sed -i '' "s/3.0.1-SNAPSHOT/3.0.1/g" CI/pom.xml.bash
|
||||
|
||||
57
bin/utils/release_version_update_docs.sh
Executable file
57
bin/utils/release_version_update_docs.sh
Executable file
@@ -0,0 +1,57 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# usage: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1
|
||||
#
|
||||
# Copyright 2018 OpenAPI-Generator Contributors (https://openapi-generator.tech)
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
if [[ "$1" != "" ]]; then
|
||||
FROM="$1"
|
||||
else
|
||||
echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [[ "$2" != "" ]]; then
|
||||
TO="$2"
|
||||
else
|
||||
echo "Missing argument. Usage e.g.: ./bin/utils/release_version_update.sh 3.0.1-SNAPSHOT 3.0.1"
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
||||
echo "IMPORTANT: this script works on Mac only"
|
||||
echo "Release preparation: replacing $FROM with $TO in different files"
|
||||
|
||||
declare -a files=("modules/openapi-generator-maven-plugin/README.md"
|
||||
"modules/openapi-generator-maven-plugin/examples/java-client.xml"
|
||||
"modules/openapi-generator-maven-plugin/examples/non-java-invalid-spec.xml"
|
||||
"modules/openapi-generator-maven-plugin/examples/non-java.xml"
|
||||
"modules/openapi-generator-gradle-plugin/README.adoc"
|
||||
"modules/openapi-generator-gradle-plugin/samples/local-spec/gradle.properties"
|
||||
"modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle"
|
||||
"modules/openapi-generator-gradle-plugin/samples/local-spec/README.md"
|
||||
"README.md")
|
||||
|
||||
for filename in "${files[@]}"; do
|
||||
# e.g. sed -i '' "s/3.0.1-SNAPSHOT/3.0.1/g" CI/pom.xml.bash
|
||||
#echo "Running command: sed -i '' "s/$FROM/$TO/g" $filename"
|
||||
if sed -i '' "s/$FROM/$TO/g" $filename; then
|
||||
echo "Updated $filename successfully!"
|
||||
else
|
||||
echo "ERROR: Failed to update $filename with the following command"
|
||||
echo "sed -i '' \"s/$FROM/$TO/g\" $filename"
|
||||
fi
|
||||
done
|
||||
2
bin/windows/typescript-inversify.bat → bin/windows/cpp-qt5-qhttpengine-server-petstore.bat
Executable file → Normal file
2
bin/windows/typescript-inversify.bat → bin/windows/cpp-qt5-qhttpengine-server-petstore.bat
Executable file → Normal file
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-inversify -o samples\client\petstore\typescript-inversify
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g cpp-qt5-qhttpengine-server -o samples\server\petstore\cpp-qt5-qhttpengine-server
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples/client/petstore/csharp/SwaggerClientNet40 --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c ./bin/csharp-petstore-net-40.json
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\SwaggerClientNet40 --additional-properties packageGuid={321C8C3F-0156-40C1-AE42-D59761FB9B6C} -c .\bin\csharp-petstore-net-40.json
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\SwaggerClientNetStandard --additional-properties targetFramework=v5.0,packageGuid={3AB1F259-1769-484B-9411-84505FCCBD55}
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore-with-fake-endpoints-models-for-testing.yaml -g csharp -o samples\client\petstore\csharp\SwaggerClientNetStandard --additional-properties targetFramework=v5.0,packageGuid={3AB1F259-1769-484B-9411-84505FCCBD55}
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -9,7 +9,7 @@ set ags=generate -i modules\openapi-generator\src\test/resources\2_0\petstore-wi
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
# restore csproj file
|
||||
echo "restore csproject file: CI\samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj"
|
||||
copy .\CI\samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj .\samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\
|
||||
REM restore csproj file
|
||||
echo "restore csproject file: CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj"
|
||||
copy /b/v/y CI\samples.ci\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj samples\client\petstore\csharp\OpenAPIClient\src\Org.OpenAPITools.Test\
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html -o samples\client\petstore\html
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html -o samples\documentation\html
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M -DloggerPath=conf/log4j.properties
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html2 -o samples\html2
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g html2 -o samples\documentation\html2
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g php -o samples\client\petstore\php
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g php -o samples\client\petstore\php\OpenAPIClient-php
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g php-silex -o samples\server\petstore\php-silex
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g php-silex -o samples\server\petstore\php-silex\OpenAPIServer
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g php-symfony -o samples\server\petstore\php-symfony
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g php-symfony -o samples\server\petstore\php-symfony\SymfonyBundle-php
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -5,6 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -c bin\typescript-petstore-npm.json -g typescript-angular -o samples\client\petstore\typescript-angular-v2\with-interfaces -D withInterfaces=true --additional-properties ngVersion=2
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-angular -o samples\client\petstore\typescript-angular-v2\with-interfaces -D withInterfaces=true --additional-properties ngVersion=2
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -4,9 +4,6 @@ If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\default --additional-properties ngVersion=6.0.0
|
||||
REM it is same like like setting -D providedInRoot=true
|
||||
REM set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -c bin\typescript-angular-v6-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\with-npm -D providedInRoot=true --additional-properties ngVersion=6.0.0
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -c bin/typescript-angular-v6-petstore-provided-in-root-with-npm.json -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\with-npm --additional-properties ngVersion=6.0.0
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -4,9 +4,6 @@ If Not Exist %executable% (
|
||||
mvn clean package
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\default --additional-properties ngVersion=6.0.0
|
||||
REM it is same like like setting -D providedInRoot=true
|
||||
REM set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\default -D providedInRoot=true --additional-properties ngVersion=6.0.0
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -l typescript-angular -o samples\client\petstore\typescript-angular-v6-provided-in-root\builds\default --additional-properties ngVersion=6.0.0
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
@ECHO OFF
|
||||
|
||||
set executable=.\modules\openapi-generator-cli\target\openapi-generator-cli.jar
|
||||
|
||||
If Not Exist %executable% (
|
||||
@@ -7,8 +5,6 @@ If Not Exist %executable% (
|
||||
)
|
||||
|
||||
REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M
|
||||
|
||||
echo
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-inversify -o samples\client\petstore\typescript-inversify\builds\default
|
||||
set ags=generate -i modules\openapi-generator\src\test\resources\2_0\petstore.yaml -g typescript-inversify -o samples\client\petstore\typescript-inversify
|
||||
|
||||
java %JAVA_OPTS% -jar %executable% %ags%
|
||||
|
||||
2
bin/windows/typescript-node-petstore-all.bat
Normal file
2
bin/windows/typescript-node-petstore-all.bat
Normal file
@@ -0,0 +1,2 @@
|
||||
call .\bin\windows\typescript-node-petstore.bat
|
||||
call .\bin\windows\typescript-node-petstore-with-npm.bat
|
||||
51
circle.yml
51
circle.yml
@@ -1,10 +1,16 @@
|
||||
version: 2
|
||||
jobs:
|
||||
build:
|
||||
# docker:
|
||||
# #- image: openapitools/openapi-generator
|
||||
# - image: swaggerapi/petstore
|
||||
# environment:
|
||||
# SWAGGER_HOST=http://petstore.swagger.io
|
||||
# SWAGGER_BASE_PATH=/v2
|
||||
machine:
|
||||
docker_layer_caching: true
|
||||
working_directory: ~/OpenAPITools/openapi-generator
|
||||
parallelism: 1
|
||||
parallelism: 2
|
||||
shell: /bin/bash --login
|
||||
environment:
|
||||
CIRCLE_ARTIFACTS: /tmp/circleci-artifacts
|
||||
@@ -12,6 +18,13 @@ jobs:
|
||||
DOCKER_GENERATOR_IMAGE_NAME: openapitools/openapi-generator
|
||||
DOCKER_CODEGEN_CLI_IMAGE_NAME: openapitools/openapi-generator-cli
|
||||
steps:
|
||||
# Restore the dependency cache
|
||||
- restore_cache:
|
||||
keys:
|
||||
# Default branch if not
|
||||
- source-v1-{{ .Branch }}-{{ .Revision }}
|
||||
- source-v1-{{ .Branch }}-
|
||||
- source-v1-
|
||||
# Machine Setup
|
||||
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
|
||||
# The following `checkout` command checks out your code to your working directory. In 1.0 we did this implicitly. In 2.0 you can choose where in the course of a job your code should be checked out.
|
||||
@@ -30,19 +43,6 @@ jobs:
|
||||
printf '127.0.0.1 petstore.swagger.io
|
||||
' | sudo tee -a /etc/hosts
|
||||
# Dependencies
|
||||
# This would typically go in either a build or a build-and-test job when using workflows
|
||||
# Restore the dependency cache
|
||||
- restore_cache:
|
||||
keys:
|
||||
# This branch if available
|
||||
- v1-dep-{{ .Branch }}-
|
||||
# Default branch if not
|
||||
- v1-dep-master-
|
||||
# This is based on your 1.0 configuration file or project settings
|
||||
- run: sudo add-apt-repository ppa:duggan/bats --yes
|
||||
- run: sudo apt-get update -qq
|
||||
- run: sudo apt-get install -qq bats
|
||||
- run: sudo apt-get install -qq curl
|
||||
# Install latest stable node for angular 6
|
||||
- run:
|
||||
name: Install node@stable (for angular 6)
|
||||
@@ -65,11 +65,12 @@ jobs:
|
||||
- run: docker ps -a
|
||||
- run: sleep 30
|
||||
- run: cat /etc/hosts
|
||||
# This is based on your 1.0 configuration file or project settings
|
||||
- run: cp CI/pom.xml.circleci pom.xml
|
||||
# Test
|
||||
- run: mvn --quiet clean install
|
||||
- run: ./CI/circle_parallel.sh
|
||||
# Save dependency cache
|
||||
- save_cache:
|
||||
key: v1-dep-{{ .Branch }}
|
||||
key: source-v1-{{ .Branch }}-{{ .Revision }}
|
||||
paths:
|
||||
# This is a broad list of cache paths to include many possible development environments
|
||||
# You can probably delete some of these entries
|
||||
@@ -81,21 +82,7 @@ jobs:
|
||||
- ~/.go_workspace
|
||||
- ~/.gradle
|
||||
- ~/.cache/bower
|
||||
# These cache paths were specified in the 1.0 config
|
||||
- ~/.sbt
|
||||
# Test
|
||||
# This would typically be a build job when using workflows, possibly combined with build
|
||||
# This is based on your 1.0 configuration file or project settings
|
||||
- run: java -version
|
||||
- run: mvn --quiet clean install
|
||||
- run: mvn --quiet verify -Psamples
|
||||
- run: if [ $? -ne 0 ]; then exit 1; fi
|
||||
- run: sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
|
||||
- run: java -version
|
||||
- run: cp CI/pom.xml.circleci.java7 pom.xml
|
||||
- run: mvn --quiet clean install
|
||||
- run: mvn --quiet verify -Psamples
|
||||
- run: if [ $? -ne 0 ]; then exit 1; fi
|
||||
- ".git"
|
||||
# Teardown
|
||||
# If you break your build into multiple jobs with workflows, you will probably want to do the parts of this that are relevant in each
|
||||
# Save test results
|
||||
|
||||
@@ -35,6 +35,8 @@ These names can be anything you like. If you are building a client for the white
|
||||
|
||||
**NOTE** Convention is to use kebab casing for names passed to `-n`. Example, `scala-finatra` would become `ScalaFinatraGenerator`.
|
||||
|
||||
#### Use your new generator with the CLI
|
||||
|
||||
To compile your library, enter the `out/generators/my-codegen` directory, run `mvn package` and execute the generator:
|
||||
|
||||
```sh
|
||||
@@ -50,11 +52,59 @@ Note the `my-codegen` is an option for `-g` now, and you can use the usual argum
|
||||
|
||||
```sh
|
||||
java -cp out/codegens/customCodegen/target/my-codegen-openapi-generator-1.0.0.jar:modules/openapi-generator-cli/target/openapi-generator-cli.jar \
|
||||
io.openapitools.codegen.OpenAPIGenerator generate -g my-codegen \
|
||||
org.openapitools.codegen.OpenAPIGenerator generate -g my-codegen \
|
||||
-i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
|
||||
-o ./out/myClient
|
||||
```
|
||||
|
||||
For Windows users:
|
||||
```
|
||||
java -cp out/codegens/customCodegen/target/my-codegen-openapi-generator-1.0.0.jar;modules/openapi-generator-cli/target/openapi-generator-cli.jar \
|
||||
org.openapitools.codegen.OpenAPIGenerator generate -g my-codegen \
|
||||
-i https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
|
||||
-o ./out/myClient
|
||||
```
|
||||
|
||||
#### Use your new generator with the maven plugin
|
||||
|
||||
Install your library to your local maven repository by running:
|
||||
|
||||
```
|
||||
mvn clean install -f out/generators/my-codegen
|
||||
```
|
||||
|
||||
This will install `org.openapitools:my-codegen-openapi-generator:1.0.0` to your local maven repository.
|
||||
|
||||
You can use this as additional dependency of the `openapi-generator-maven-plugin` plugin and use `my-codegen` as `generatorName` value:
|
||||
|
||||
```xml
|
||||
<plugin>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-maven-plugin</artifactId>
|
||||
<version>${openapi-generator-version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-client-code</id>
|
||||
<goals>
|
||||
<goal>generate</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<generatorName>my-codegen</generatorName>
|
||||
<!-- other configuration ... -->
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>my-codegen-openapi-generator</artifactId>
|
||||
<version>1.0.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
```
|
||||
|
||||
If you publish your artifact to a distant maven repository, do not forget to add this repository as `pluginRepository` for your project.
|
||||
|
||||
### Selective generation
|
||||
You may not want to generate *all* models in your project. Likewise you may want just one or two apis to be written. If that's the case, you can use system properties to control the output:
|
||||
@@ -106,6 +156,14 @@ java -Dapis -DmodelTests=false {opts}
|
||||
|
||||
When using selective generation, _only_ the templates needed for the specific generation will be used.
|
||||
|
||||
To skip models defined as the form parameters in "requestBody", please use `skipFormModel` (default to false) (this option is introduced at v3.2.2)
|
||||
|
||||
```sh
|
||||
java -DskipFormModel=true
|
||||
```
|
||||
|
||||
This option will be helpful to skip model generation due to the form parameter, which is defined differently in OAS3 as there's no form parameter in OAS3
|
||||
|
||||
### Ignore file format
|
||||
|
||||
OpenAPI Generator supports a `.openapi-generator-ignore` file, similar to `.gitignore` or `.dockerignore` you're probably already familiar with.
|
||||
|
||||
@@ -246,8 +246,8 @@ If your API client is using named parameters in the function call (e.g. Perl req
|
||||
|
||||
The following gnereators are not yet fully migrated and tested
|
||||
|
||||
- `rust-server`
|
||||
- `apex`
|
||||
- ~~rust-server~~ (migrated)
|
||||
- `apex` (migration scheduled in Jul/Aug 2018)
|
||||
|
||||
and we welcome contributions from the community to help with the migration
|
||||
|
||||
|
||||
@@ -11,6 +11,42 @@ Another approach to find breaking changes is to look at issue and pull requests
|
||||
* link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28with%20fallback%29[Breaking change (with fallback)]
|
||||
* link:https://github.com/OpenAPITools/openapi-generator/labels/Breaking%20change%20%28without%20fallback%29[Breaking change (without fallback)]
|
||||
|
||||
=== From 3.1.x to 3.2.0
|
||||
|
||||
Version `3.2.0` is a minor version of OpenAPI-Generator, in comparison to `3.1.x` it contains some breaking changes, but with the possibility to fallback to the old behavior.
|
||||
The default value of some options might change.
|
||||
Projects relying on generated code might need to be adapted.
|
||||
|
||||
==== Validate spec on generation by default
|
||||
|
||||
The default is to validate the spec during generation. If the spec has errors,
|
||||
they will appear as errors or warnings to the user. This prevent generation of the project.
|
||||
|
||||
If you want to switch back to the `3.1.x` behavior you can use:
|
||||
|
||||
* Set the `validateSpec` option to `false` if you are using the Maven or Gradle plugin
|
||||
* Use the command line option `--skip-validate-spec` if you are using the CLI
|
||||
|
||||
|
||||
==== Model (all languages)
|
||||
|
||||
In `CodegenModel` and in `CodegenOperation` we use now our own class `org.openapitools.codegen.CodegenDiscriminator` instead of `io.swagger.v3.oas.models.media.Discriminator`.
|
||||
|
||||
For the templates, this is not an API change, because the same values are available.
|
||||
|
||||
If you have your own `Codegen` class (to support your own generator for example) then you might get some compile error due to the change.
|
||||
|
||||
==== Java
|
||||
|
||||
Schema with enum values are mapped to java enum in the generated code.
|
||||
In previous version, when an unknown value was deserialized, the value was set to `null`.
|
||||
|
||||
With `3.2.0` a new option is introduced: `useNullForUnknownEnumValue`.
|
||||
|
||||
* When set to `false` (default value), an Exception (`IllegalArgumentException`) is thrown when the value not available in the enum.
|
||||
* When set to `true`, unknown values are mapped to `null` as it was the case in previous versions.
|
||||
|
||||
|
||||
=== From 3.0.x to 3.1.0
|
||||
|
||||
Version `3.1.0` is the first minor version of OpenAPI-Generator, in comparison to `3.0.3` it contains some breaking changes, but with the possibility to fallback to the old behavior.
|
||||
|
||||
42
docs/qna.md
42
docs/qna.md
@@ -2,38 +2,40 @@
|
||||
|
||||
#### What is the governance structure of the OpenAPI Generator project?
|
||||
|
||||
OpenAPI generator (openapi-generator) is managed by the [core team members](../README.md#openapi-generator-core-team).
|
||||
OpenAPI generator (openapi-generator) is managed by the members of the [core team](../README.md#openapi-generator-core-team).
|
||||
|
||||
|
||||
#### What is the difference between Swagger Codegen and OpenAPI Generator?
|
||||
|
||||
Swagger Codegen is driven by SmartBear while OpenAPI Generator is driven by the community. More than 40 top contributors and template creators of Swagger Codegen have joined OpenAPI Generator as the founding team members.
|
||||
|
||||
Swagger is a trademark owned by SmartBear and the use of the term "Swagger" in this project is for demo (reference) purposes only.
|
||||
|
||||
|
||||
#### Why was it decided to fork Swagger Codegen and to maintain a community-driven version?
|
||||
|
||||
There are several reasons:
|
||||
|
||||
1. The founding members came to the conclusion that Swagger Codegen 3.0.0 beta contains too many breaking changes while they strongly believe 3.0.0 release should only focus on one thing: OpenAPI specification 3.0 support.
|
||||
1. Swagger Codegen 3.0.0 beta was evaluated as unstable. Changes made directly to 3.0.0 branch without reviews or tests, were breaking the builds from time to time (e.g. a simple `mvn clean package` failed).
|
||||
1. Reviews of code changes in the 3.0.0 branch highlighted a lot of code block removal without any reason. This might produce regressions for edge cases discovered previously.
|
||||
1. Most of the test cases in the generators have been commented out as part of the migration to support OpenAPI 3.0. Test cases are the most valuable assets of the project and should be maintained to ensure a good quality.
|
||||
1. According to SmartBear, [Swagger Codegen 2.x and 3.x should be supported in parallel for a while](https://github.com/swagger-api/swagger-codegen/issues/7754#issuecomment-375039048) without the possibility to work with git branches to merge the fixes from one branch to the next. Having to implement everything twice is not a good idea and the best use of the Swagger Codegen community resources.
|
||||
1. Having a community-driven version can bring the project to the next level.
|
||||
1. The founding members came to the conclusion that Swagger Codegen 3.0.0 beta contains too many breaking changes. They also strongly believe the 3.0.0 release should only focus on one thing: OpenAPI 3.0 support.
|
||||
1. The founding members had concerns about the development practices, which seemed to be contributing to an unstable and insufficiently tested codebase.
|
||||
1. There was a disagreement on the evolutionary strategy for Swagger Codegen. The founding members felt it was important to move forward with OpenAPI 3.0 support, while maintaining backward compatibility with OpenAPI 2.0 in the same codebase.
|
||||
1. The founding members found that the enhancements and bug fixes submitted for Swagger Codegen 2.x need to be submitted again for Swagger Codegen 3.0.0 branch (otherwise, these changes would not appear in the 3.0.0 branch. Having to do the pull request twice is not the best use of community resources).
|
||||
1. The community-driven version has a more rapid [release cycle](https://github.com/OpenAPITools/openapi-generator/releases/) (weekly patch release, monthly minor release) so users do not need to wait for several months to get a stable release.
|
||||
1. Having a community-driven version _can_ bring the project to the next level with reliable releases and a clear [roadmap](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/roadmap.adoc).
|
||||
|
||||
UPDATE: After the public launch of OpenAPI Generator, some of the core team members were contacted by Ron (SmartBear) and we explained to him the reasons of the fork as explained above. We also asked him to contact team@openapitools.org if he wants to discuss further but so far we don't see any email from him to team@openapitools.org.
|
||||
#### Was anything done to attempt to address the issues before deciding to fork Swagger Codegen and maintain a community-driven version?
|
||||
|
||||
#### Has anything been done in attempt to address the issues before deciding to fork Swagger Codegen and maintain a community-driven version?
|
||||
|
||||
There were several conversations with SmartBear (Ron, Hugo) via emails, gitter, Skype call and GitHub issues.
|
||||
There were several conversations with the project owners of Swagger Codegen via emails, Gitter, Skype call and GitHub issues to discuss the state of Swagger Codegen 3.0.0.
|
||||
But there was no consensus on the next steps and on the direction for Swagger Codegen 3.0.0.
|
||||
|
||||
#### Is there any change to the project license?
|
||||
#### Are there any changes to the project license?
|
||||
|
||||
No, OpenAPI Generator is still using [Apache license (version 2)](https://www.apache.org/licenses/LICENSE-2.0).
|
||||
No, OpenAPI Generator is still using the [Apache license (version 2)](https://www.apache.org/licenses/LICENSE-2.0).
|
||||
|
||||
#### What is the difference between Swagger Codegen and OpenAPI Generator?
|
||||
#### I am currently using Swagger Codegen 2.x. How can I upgrade the generator to OpenAPI Generator?
|
||||
|
||||
Swagger Codegen is driven by SmartBear while OpenAPI Generator is driven by the community. More than 40 top contributors and template creators of Swagger Codegen have joined OpenAPI Generator as the founding team members.
|
||||
OpenAPI Generator is based on Swagger Codegen `2.4.0-SNAPSHOT` version so the migration should be relatively straightforward. Refer to the [migration guide](migration-from-swagger-codegen.md) for more information.
|
||||
|
||||
Swagger is a trademark owned by SmartBear and the use of the term "Swagger" found in this project is for demo purpose (reference) only.
|
||||
|
||||
#### I’m currently using Swagger Codegen 2.x. How can I upgrade the generator to OpenAPI Generator?
|
||||
|
||||
OpenAPI Generator is based on Swagger Codegen 2.4.0-SNAPSHOT version so the migration should be easy, straightforward and almost seamless. Please refer to the [migration guide](migration-from-swagger-codegen.md) for more information.
|
||||
#### Who maintains this Q&A page?
|
||||
|
||||
This Q&A page is maintained by the [core team members](../README.md#openapi-generator-core-team). It is not maintained by a single person nor do these Q&As represent the views of any individual or person.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.2.2</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -19,10 +19,13 @@ package org.openapitools.codegen;
|
||||
|
||||
import io.airlift.airline.Cli;
|
||||
import io.airlift.airline.Help;
|
||||
import io.airlift.airline.ParseArgumentsUnexpectedException;
|
||||
import io.airlift.airline.ParseOptionMissingException;
|
||||
import io.airlift.airline.ParseOptionMissingValueException;
|
||||
import org.openapitools.codegen.cmd.*;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* User: lanwen Date: 24.03.15 Time: 17:56
|
||||
* <p>
|
||||
@@ -39,6 +42,7 @@ public class OpenAPIGenerator {
|
||||
Cli.<Runnable>builder("openapi-generator-cli")
|
||||
.withDescription(
|
||||
String.format(
|
||||
Locale.ROOT,
|
||||
"OpenAPI generator CLI (version %s).",
|
||||
version))
|
||||
.withDefaultCommand(ListGenerators.class)
|
||||
@@ -67,8 +71,11 @@ public class OpenAPIGenerator {
|
||||
if (args.length == 0) {
|
||||
System.exit(1);
|
||||
}
|
||||
} catch (ParseArgumentsUnexpectedException e) {
|
||||
System.err.printf(Locale.ROOT,"[error] %s%n%nSee 'openapi-generator-cli help' for usage.%n", e.getMessage());
|
||||
System.exit(1);
|
||||
} catch (ParseOptionMissingException | ParseOptionMissingValueException e) {
|
||||
System.err.printf("[error] %s%n", e.getMessage());
|
||||
System.err.printf(Locale.ROOT,"[error] %s%n", e.getMessage());
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,18 +23,41 @@ import org.openapitools.codegen.CliOption;
|
||||
import org.openapitools.codegen.CodegenConfig;
|
||||
import org.openapitools.codegen.CodegenConfigLoader;
|
||||
import org.openapitools.codegen.GeneratorNotFoundException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.isEmpty;
|
||||
import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
|
||||
@Command(name = "config-help", description = "Config help for chosen lang")
|
||||
public class ConfigHelp implements Runnable {
|
||||
|
||||
@Option(name = {"-l", "--lang"}, title = "language", required = true,
|
||||
private static final Logger LOGGER = LoggerFactory.getLogger(Generate.class);
|
||||
|
||||
@Option(name = {"-l", "--lang"}, title = "language",
|
||||
description = "language to get config help for")
|
||||
private String lang;
|
||||
|
||||
@Option(name = {"-g", "--generator-name"}, title = "generator name",
|
||||
description = "generator to get config help for")
|
||||
private String generatorName;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
// TODO: After 3.0.0 release (maybe for 3.1.0): Fully deprecate lang.
|
||||
if (isEmpty(generatorName)) {
|
||||
if (isNotEmpty(lang)) {
|
||||
LOGGER.warn("The '--lang' and '-l' are deprecated and may reference language names only in the next major release (4.0). Please use --generator-name /-g instead.");
|
||||
generatorName = lang;
|
||||
} else {
|
||||
System.err.println("[error] A generator name (--generator-name / -g) is required.");
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
CodegenConfig config = CodegenConfigLoader.forName(lang);
|
||||
CodegenConfig config = CodegenConfigLoader.forName(generatorName);
|
||||
System.out.println();
|
||||
System.out.println("CONFIG OPTIONS");
|
||||
for (CliOption langCliOption : config.cliOptions()) {
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
|
||||
package org.openapitools.codegen.cmd;
|
||||
|
||||
import ch.qos.logback.classic.LoggerContext;
|
||||
import ch.qos.logback.core.spi.FilterAttachable;
|
||||
import io.airlift.airline.Command;
|
||||
import io.airlift.airline.Option;
|
||||
import org.openapitools.codegen.ClientOptInput;
|
||||
@@ -32,6 +34,7 @@ import static org.apache.commons.lang3.StringUtils.isNotEmpty;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
/**
|
||||
* User: lanwen Date: 24.03.15 Time: 20:22
|
||||
@@ -194,8 +197,28 @@ public class Generate implements Runnable {
|
||||
description = CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DESC)
|
||||
private Boolean removeOperationIdPrefix;
|
||||
|
||||
@Option(name = {"--skip-validate-spec"},
|
||||
title = "skip spec validation",
|
||||
description = "Skips the default behavior of validating an input specification.")
|
||||
private Boolean skipValidateSpec;
|
||||
|
||||
@Option(name = {"--log-to-stderr"},
|
||||
title = "Log to STDERR",
|
||||
description = "write all log messages (not just errors) to STDOUT."
|
||||
+ " Useful for piping the JSON output of debug options (e.g. `-DdebugOperations`) to an external parser directly while testing a generator.")
|
||||
private Boolean logToStderr;
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (logToStderr != null) {
|
||||
LoggerContext lc = (LoggerContext) LoggerFactory.getILoggerFactory();
|
||||
Stream.of(Logger.ROOT_LOGGER_NAME, "io.swagger", "org.openapitools")
|
||||
.map(lc::getLogger)
|
||||
.peek(logger -> logger.detachAppender("STDOUT"))
|
||||
.reduce((logger, next) -> logger.getName().equals(Logger.ROOT_LOGGER_NAME) ? logger : next)
|
||||
.map(root -> root.getAppender("STDERR"))
|
||||
.ifPresent(FilterAttachable::clearAllFilters);
|
||||
}
|
||||
|
||||
// attempt to read from config file
|
||||
CodegenConfigurator configurator = CodegenConfigurator.fromFile(configFile);
|
||||
@@ -207,6 +230,10 @@ public class Generate implements Runnable {
|
||||
}
|
||||
|
||||
// now override with any specified parameters
|
||||
if (skipValidateSpec != null) {
|
||||
configurator.setValidateSpec(false);
|
||||
}
|
||||
|
||||
if (verbose != null) {
|
||||
configurator.setVerbose(verbose);
|
||||
}
|
||||
|
||||
@@ -21,6 +21,8 @@ import ch.lambdaj.collection.LambdaIterable;
|
||||
import io.airlift.airline.Command;
|
||||
import org.openapitools.codegen.CodegenConfig;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import static ch.lambdaj.Lambda.on;
|
||||
import static ch.lambdaj.collection.LambdaCollections.with;
|
||||
import static java.util.ServiceLoader.load;
|
||||
@@ -34,6 +36,6 @@ public class Langs implements Runnable {
|
||||
public void run() {
|
||||
LambdaIterable<String> langs =
|
||||
with(load(CodegenConfig.class)).extract(on(CodegenConfig.class).getName());
|
||||
System.out.printf("Available languages (generators): %s%n", langs);
|
||||
System.out.printf(Locale.ROOT, "Available languages (generators): %s%n", langs);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import org.openapitools.codegen.CodegenType;
|
||||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
// NOTE: List can later have subcommands such as list languages, list types, list frameworks, etc.
|
||||
@Command(name = "list", description = "Lists the available generators")
|
||||
@@ -53,6 +54,6 @@ public class ListGenerators implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
System.out.printf("%s%n", sb.toString());
|
||||
System.out.printf(Locale.ROOT,"%s%n", sb.toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
This document describes the gradle plugin for OpenAPI Generator.
|
||||
|
||||
This gradle plugin offers a declarative DSL via _extensions_ (these are Gradle project extensions).
|
||||
These map almost fully 1:1 with the options you'd pass to the CLI or Maven plugin. The plugin maps the extensions to a task of the same name to provide a clean API. If you're interested in the extension/task mapping concept from a high-level, you can https://docs.gradle.org/current/userguide/custom_plugins.html#sec:mapping_extension_properties_to_task_properties[check out Gradle's docs].
|
||||
|
||||
== Tasks
|
||||
|
||||
Tasks are listed under the "OpenAPI Tools" tasks heading.
|
||||
@@ -24,6 +27,17 @@ Tasks are listed under the "OpenAPI Tools" tasks heading.
|
||||
|Validates an Open API 2.0 or 3.x specification document.
|
||||
|===
|
||||
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
The plugin implements the above tasks as project extensions of the same name. If you'd like to declare
|
||||
these tasks as dependencies to other tasks (using `dependsOn`), you'll need a task reference. e.g.:
|
||||
|
||||
```
|
||||
compileJava.dependsOn tasks.openApiGenerate
|
||||
```
|
||||
====
|
||||
|
||||
== Plugin Setup
|
||||
|
||||
[source,groovy]
|
||||
@@ -34,7 +48,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:3.0.3"
|
||||
classpath "org.openapitools:openapi-generator-gradle-plugin:3.2.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +73,11 @@ The gradle plugin is not currently published to https://plugins.gradle.org/m2/.
|
||||
|false
|
||||
|The verbosity of generation
|
||||
|
||||
|validateSpec
|
||||
|Boolean
|
||||
|true
|
||||
|Whether or not we should validate the input spec before generation. Invalid specs result in an error.
|
||||
|
||||
|generatorName
|
||||
|String
|
||||
|None
|
||||
@@ -450,3 +469,65 @@ Run with --stacktrace option to get the stack trace. Run with --info or --debug
|
||||
----
|
||||
$ ./gradlew openApiValidate --input=/Users/jim/projects/openapi-generator/modules/openapi-generator/src/test/resources/3_0/petstore.yaml
|
||||
----
|
||||
|
||||
=== Generate multiple sources
|
||||
|
||||
If you want to perform multiple generation tasks, you'd want to create a task that inherits from the `GenerateTask`.
|
||||
Examples can be found in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/samples/local-spec/build.gradle[samples/local-spec/build.gradle].
|
||||
|
||||
You can define any number of generator tasks; the generated code does _not_ need to be a JVM language.
|
||||
|
||||
```gradle
|
||||
task buildGoClient(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
|
||||
generatorName = "go"
|
||||
inputSpec = "$rootDir/petstore-v3.0.yaml".toString()
|
||||
additionalProperties = [
|
||||
packageName: "petstore"
|
||||
]
|
||||
outputDir = "$buildDir/go".toString()
|
||||
configOptions = [
|
||||
dateLibrary: "threetenp"
|
||||
]
|
||||
}
|
||||
task buildKotlinClient(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
|
||||
generatorName = "kotlin"
|
||||
inputSpec = "$rootDir/petstore-v3.0.yaml".toString()
|
||||
outputDir = "$buildDir/kotlin".toString()
|
||||
apiPackage = "org.openapitools.example.api"
|
||||
invokerPackage = "org.openapitools.example.invoker"
|
||||
modelPackage = "org.openapitools.example.model"
|
||||
configOptions = [
|
||||
dateLibrary: "java8"
|
||||
]
|
||||
systemProperties = [
|
||||
modelDocs: "false"
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
To execute your specs, you'd then do:
|
||||
|
||||
```
|
||||
./gradlew buildGoClient buildKotlinClient
|
||||
```
|
||||
|
||||
If you want to simplify the execution, you could create a new task with `dependsOn`.
|
||||
|
||||
```gradle
|
||||
task codegen(dependsOn: ['buildGoClient', 'buildKotlinClient'])
|
||||
```
|
||||
|
||||
Or, if you're generating the code on compile, you can add these as a dependency to `compileJava` or any other existing task.
|
||||
You can also mix the default task `openApiGenerate` with custom tasks:
|
||||
|
||||
```gradle
|
||||
compileJava.dependsOn buildKotlinClient, tasks.openApiGenerate
|
||||
```
|
||||
|
||||
[NOTE]
|
||||
====
|
||||
`openApiGenerate` is a project extension _and_ a task. If you want to use this in `dependsOn`,
|
||||
you need a task reference or instance. One way to do this is to access it as `tasks.openApiGenerate`.
|
||||
|
||||
You can run `gradle tasks --debug` to see this registration.
|
||||
====
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
openApiGeneratorVersion=3.1.0-SNAPSHOT
|
||||
openApiGeneratorVersion=3.2.2
|
||||
|
||||
# BEGIN placeholders
|
||||
# these are just placeholders to allow contributors to build directly
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<parent>
|
||||
<groupId>org.openapitools</groupId>
|
||||
<artifactId>openapi-generator-project</artifactId>
|
||||
<version>3.1.0-SNAPSHOT</version>
|
||||
<version>3.2.2</version>
|
||||
<relativePath>../..</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
@@ -11,10 +11,11 @@ gradle openApiGenerate
|
||||
gradle openApiMeta
|
||||
gradle openApiValidate
|
||||
gradle buildGoSdk
|
||||
gradle generateGoWithInvalidSpec
|
||||
```
|
||||
|
||||
The samples can be tested against other versions of the plugin using the `openApiGeneratorVersion` property. For example:
|
||||
|
||||
```bash
|
||||
gradle -PopenApiGeneratorVersion=3.0.3 openApiValidate
|
||||
gradle -PopenApiGeneratorVersion=3.2.2 openApiValidate
|
||||
```
|
||||
|
||||
@@ -41,6 +41,9 @@ openApiGenerate {
|
||||
configOptions = [
|
||||
dateLibrary: "java8"
|
||||
]
|
||||
systemProperties = [
|
||||
modelDocs: "false"
|
||||
]
|
||||
}
|
||||
|
||||
task buildGoSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
|
||||
@@ -54,3 +57,16 @@ task buildGoSdk(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTas
|
||||
dateLibrary: "threetenp"
|
||||
]
|
||||
}
|
||||
|
||||
task generateGoWithInvalidSpec(type: org.openapitools.generator.gradle.plugin.tasks.GenerateTask){
|
||||
validateSpec = true
|
||||
generatorName = "go"
|
||||
inputSpec = "$rootDir/petstore-v3.0-invalid.yaml".toString()
|
||||
additionalProperties = [
|
||||
packageName: "petstore"
|
||||
]
|
||||
outputDir = "$buildDir/go".toString()
|
||||
configOptions = [
|
||||
dateLibrary: "threetenp"
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1 +1 @@
|
||||
openApiGeneratorVersion=3.0.1
|
||||
openApiGeneratorVersion=3.2.2
|
||||
|
||||
@@ -80,6 +80,7 @@ class OpenApiGeneratorPlugin : Plugin<Project> {
|
||||
description = "Generate code via Open API Tools Generator for Open API 2.0 or 3.x specification documents."
|
||||
|
||||
verbose.set(generate.verbose)
|
||||
validateSpec.set(generate.validateSpec)
|
||||
generatorName.set(generate.generatorName)
|
||||
outputDir.set(generate.outputDir)
|
||||
inputSpec.set(generate.inputSpec)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user