openapi-generator/bin/ruby-client-petstore-faraday.sh
Dennis Kliban bcc3a9ecf7 Ruby client faraday (#3405)
* WIP: add faraday support to Ruby client

* update samples

* bin/console

* https only

* ruby-faraday: Add a gemspec template for faraday

* Add a test for ruby-faraday client options

* Remove Gemfile.lock from ruby-client-faraday

* Implement faraday client

* Problem: can't use Faraday library for ruby clients

Solution: add support for Faraday library

This patch builds on the work started by @meganemura

* Problem: Faraday is set as default library

Solution: Make Typhoeus default

This patch also updates the api_client template for Faraday to include query params with requests.
2019-08-01 11:08:34 +08:00

33 lines
975 B
Bash
Executable File

#!/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-faraday.json -o samples/client/petstore/ruby-faraday $@"
java $JAVA_OPTS -jar $executable $ags