Skip to content

Commit

Permalink
Problem: ruby client can't form-encode PUT requests
Browse files Browse the repository at this point in the history
Solution: switch ruby client to use Faraday

This patch relies on a forked version of the openapi-generator-cli. Once the PR that
introduces this functionality is merged into openapi-generator, the ruby client
generation should be switched back to using the docker container for openapi-generator.

OpenAPITools/openapi-generator#3405

re: #4896
https://pulp.plan.io/issues/4896
  • Loading branch information
dkliban committed Jul 23, 2019
1 parent 103d6f0 commit 5270599
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ if [ -n "$PULP_PR_NUMBER" ]; then
fi

pip install -e ./pulpcore[postgres]
cp ./pulpcore/.travis/test_bindings.py $TRAVIS_BUILD_DIR/
cp ./pulpcore/.travis/test_bindings.py $TRAVIS_BUILD_DIR/.travis/
cp ./pulpcore/.travis/test_bindings.rb $TRAVIS_BUILD_DIR/.travis/

git clone https://github.com/pulp/pulpcore-plugin.git

Expand Down
2 changes: 1 addition & 1 deletion .travis/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ pip install ./pulpcore-client
pip install ./pulp_file-client

python test_bindings.py

ruby test_bindings.rb
# Travis' scripts use unbound variables. This is problematic, because the
# changes made to this script's environment appear to persist when Travis'
# scripts execute. Perhaps this script is sourced by Travis? Regardless of why,
Expand Down
10 changes: 6 additions & 4 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ then
fi
if [ $2 = 'ruby' ]
then
docker run -u $(id -u) --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.0.0 generate \
-i /local/api.json \
curl -o openapi-generator-cli.jar https://repos.fedorapeople.org/pulp/pulp/openapi/openapi-generator-cli.jar
java -jar openapi-generator-cli.jar generate \
-i api.json \
-g ruby \
-o /local/$1-client \
-o $1-client \
-DgemName=$1_client \
-DgemLicense="GPLv2" \
-DgemLicense="GPL-2.0" \
-DgemVersion=${VERSION} \
-Dlibrary=faraday \
--skip-validate-spec \
--strict-spec=false
fi
Expand Down

0 comments on commit 5270599

Please sign in to comment.