Skip to content

Commit

Permalink
Merge branch 'master' into batch-generation
Browse files Browse the repository at this point in the history
* master: (110 commits)
  [golang] Regenerate all go samples  (#3988)
  Better tests for string (number) (#3953)
  Add missing enum processing in C++ codegen, already present for Qt5 (#3986)
  [C++] [Pistache] Removed deprecated warnings (#3985)
  [C++][Pistache] Simplified model template (#3417)
  add go oas3 petstore to ensure up-to-date (#3979)
  replace gitter with slack in the doc (#3977)
  Fix wrong variable name in LessThan and LessThanOrEqual asserts (#3971)
  #3957 - Removed hardcoded baseUrl (#3964)
  Regenerate go openapi3 samples (#3975)
  [rust] Make it easier to test rust client generator (#3543)
  Fix issue3635 (#3948)
  add gradle repository (#3867)
  [java] allow to use setArtifactVersion() programmatically (#3907)
  Add a link to DevRelCon SF 2019 (#3961)
  Add a link to a medium blog post (#3960)
  update maven-compiler-plugin version (#3956)
  fix generateAliasAsModels in default generator (#3951)
  Implement BigDecimal to Decimal in swift4 for currency data as type=string format=number (#3910)
  Add F# Functions server generator (#3933)
  ...
  • Loading branch information
jimschubert committed Sep 30, 2019
2 parents c6c4d81 + 600a81f commit 92d7b9f
Show file tree
Hide file tree
Showing 3,802 changed files with 57,947 additions and 23,439 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 0 additions & 6 deletions .github/.test/samples.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,6 @@
"Documentation: Cwiki"
]
},
{
"input": "dart-flutter-petstore.sh",
"matches": [
"Client: Dart"
]
},
{
"input": "dart-jaguar-petstore.sh",
"matches": [
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ samples/client/petstore/python-tornado/.venv/
samples/client/petstore/typescript-angular2/npm/npm-debug.log
samples/client/petstore/typescript-node/npm/npm-debug.log
samples/client/petstore/typescript-angular/tsd-debug.log
samples/client/petstore/typescript-fetch/tests/**/dist/

# aspnetcore
samples/server/petstore/aspnetcore/.vs/
Expand All @@ -186,6 +187,7 @@ samples/client/petstore/kotlin-string/build
samples/openapi3/client/petstore/kotlin/build
samples/server/petstore/kotlin-server/ktor/build
samples/server/petstore/kotlin-springboot/build
samples/client/petstore/kotlin-multiplatform/build/
\?

# haskell
Expand Down
5 changes: 5 additions & 0 deletions CI/.drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ kind: pipeline
name: default

steps:
# test haskell client
- name: haskell-client-test
image: haskell:8.6.5
commands:
- (cd samples/client/petstore/haskell-http-client/ && stack --install-ghc --no-haddock-deps haddock --fast && stack test --fast)
# test Dart 2.x petstore client
- name: dart2x-test
image: google/dart
Expand Down
49 changes: 35 additions & 14 deletions README.md

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions bin/asciidoc-documentation-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

SCRIPT="$0"

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} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/openapi-generator/src/main/resources/asciidoc-documentation --additional-properties=specDir=modules/openapi-generator/src/main/resources/asciidoc-documentation,snippetDir=. -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g asciidoc -o samples/documentation/asciidoc"

java ${JAVA_OPTS} -jar ${executable} ${ags}
2 changes: 1 addition & 1 deletion bin/cpp-pistache-server-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
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 $@"
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 --additional-properties useStructModel=false -o samples/server/petstore/cpp-pistache $@"

java $JAVA_OPTS -jar $executable $ags
50 changes: 0 additions & 50 deletions bin/dart-flutter-petstore.sh

This file was deleted.

21 changes: 2 additions & 19 deletions bin/dart2-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,6 @@ fi
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"

# Generate non-browserClient
ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart2/openapi --additional-properties hideGenerationTimestamp=true,browserClient=false $@"

# then options to generate the library for vm would be:
#ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart2/openapi_vm --additional-properties browserClient=false,pubName=openapi_vm $@"
java $JAVA_OPTS -jar $executable $ags

# Generate browserClient
ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart2/openapi-browser-client --additional-properties hideGenerationTimestamp=true,browserClient=true $@"
# Generate client
ags="generate -t modules/openapi-generator/src/main/resources/dart2 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart2/openapi --additional-properties hideGenerationTimestamp=true $@"
java $JAVA_OPTS -jar $executable $ags

# Generate non-browserClient and put it to the flutter sample app
ags="generate -t modules/openapi-generator/src/main/resources/dart -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g dart -o samples/client/petstore/dart2/flutter_petstore/openapi --additional-properties hideGenerationTimestamp=true,browserClient=false $@"
java $JAVA_OPTS -jar $executable $ags

# There is a proposal to allow importing different libraries depending on the environment:
# https://github.com/munificent/dep-interface-libraries
# When this is implemented there will only be one library.

# The current petstore test will then work for both: the browser library and the vm library.
31 changes: 31 additions & 0 deletions bin/fsharp-functions-server-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

SCRIPT="$0"

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 -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g fsharp-functions -o samples/server/petstore/fsharp-functions"

java ${JAVA_OPTS} -jar ${executable} ${ags}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/rust -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g rust -o samples/client/petstore/rust-reqwest --additional-properties packageName=petstore_client --library=reqwest $@"
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin --artifact-id kotlin-client-petstore-multiplatform --library multiplatform -o samples/client/petstore/kotlin-multiplatform $@"

java ${JAVA_OPTS} -jar ${executable} ${ags}
31 changes: 31 additions & 0 deletions bin/kotlin-vertx-server-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

SCRIPT="$0"

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} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g kotlin-vertx -o samples/server/petstore/kotlin/vertx"

java ${JAVA_OPTS} -jar ${executable} ${ags}
31 changes: 31 additions & 0 deletions bin/nim-client-petstore.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

SCRIPT="$0"

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} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -t modules/openapi-generator/src/main/resources/nim-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml --additional-properties packageName=petstore -g nim -o samples/client/petstore/nim"

java ${JAVA_OPTS} -jar ${executable} ${ags}
35 changes: 35 additions & 0 deletions bin/openapi3/kotlin-client-petstore-multiplatform.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/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

export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-client-petstore-multiplatform --library multiplatform -o samples/openapi3/client/petstore/kotlin-multiplatform $@"

echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin-multiplatform"
rm -rf samples/openapi3/client/petstore/kotlin-multiplatform

echo "Generating Kotling client..."
java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/openapi3/kotlin-client-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ then
fi

export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8 -o samples/openapi3/client/petstore/kotlin $@"
ags="generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client --additional-properties dateLibrary=java8 -o samples/openapi3/client/petstore/kotlin $@"

echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin"
rm -rf samples/openapi3/client/petstore/kotlin
Expand Down
10 changes: 10 additions & 0 deletions bin/openapi3/windows/nodejs-express-server-petstore.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
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 -DloggerPath=conf/log4j.properties
set ags=generate -i modules\openapi-generator\src\test\resources\3_0\petstore.yaml -g nodejs-express-server -o samples\openapi3\server\petstore\nodejs-express-server

java %JAVA_OPTS% -jar %executable% %ags%
File renamed without changes.
32 changes: 32 additions & 0 deletions bin/protobuf-schema-petstore.sh
Original file line number Diff line number Diff line change
@@ -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} -Xmx1024M -DloggerPath=conf/log4j.properties $@"
ags="generate -t modules/openapi-generator/src/main/resources/protobuf-schema -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g protobuf-schema -o samples/config/petstore/protobuf-schema --additional-properties packageName=petstore $@"

java $JAVA_OPTS -jar $executable $ags
2 changes: 1 addition & 1 deletion bin/python-experimental-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/client/petstore/python-experimental -DpackageName=petstore_api $@"
ags="generate -t modules/openapi-generator/src/main/resources/python -i modules/openapi-generator/src/test/resources/2_0/python-client-experimental/petstore-with-fake-endpoints-models-for-testing.yaml -g python-experimental -o samples/client/petstore/python-experimental --additional-properties packageName=petstore_api $@"

java $JAVA_OPTS -jar $executable $ags
19 changes: 17 additions & 2 deletions bin/rust-petstore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,21 @@ fi

# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
ags="generate -t modules/openapi-generator/src/main/resources/rust -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g rust -o samples/client/petstore/rust --additional-properties packageName=petstore_client --library=hyper $@"

java ${JAVA_OPTS} -jar ${executable} ${ags}
for spec_path in \
modules/openapi-generator/src/test/resources/2_0/petstore.yaml \
modules/openapi-generator/src/test/resources/3_0/rust/rust-test.yaml \
modules/openapi-generator/src/test/resources/2_0/fileResponseTest.json\
; do
spec=$(basename "$spec_path" | sed 's/.yaml//' | sed 's/.json//' )

for library in hyper reqwest; do
args="generate --template-dir modules/openapi-generator/src/main/resources/rust
--input-spec $spec_path
--generator-name rust
--output samples/client/petstore/rust/$library/$spec
--additional-properties packageName=${spec}-${library}
--library=$library $@"
java ${JAVA_OPTS} -jar ${executable} ${args} || exit 1
done
done
1 change: 1 addition & 0 deletions bin/typescript-fetch-petstore-all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
./bin/typescript-fetch-petstore.sh
./bin/typescript-fetch-petstore-multiple-parameters.sh
./bin/typescript-fetch-petstore-prefix-parameter-interfaces.sh
./bin/typescript-fetch-petstore-typescript-three-plus.sh
7 changes: 7 additions & 0 deletions bin/typescript-fetch-petstore-typescript-three-plus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"npmName": "@openapitools/typescript-fetch-petstore",
"npmVersion": "1.0.0",
"npmRepository" : "https://skimdb.npmjs.com/registry",
"snapshot" : false,
"typescriptThreePlus": true
}
Loading

0 comments on commit 92d7b9f

Please sign in to comment.