Skip to content

Commit

Permalink
Merge pull request pulp#54 from dkliban/disable-uri-encoding
Browse files Browse the repository at this point in the history
Disables URL encoding of path params in the typescript-axios client
  • Loading branch information
dkliban authored Sep 23, 2021
2 parents 890420d + 4882e6e commit 48235a6
Show file tree
Hide file tree
Showing 2 changed files with 380 additions and 3 deletions.
19 changes: 16 additions & 3 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@ else
container_exec=podman
fi

if command -v getenforce > /dev/null
then
if [ "$(getenforce)" == "Enforcing" ]
then
volume_name="/local:Z"
else
volume_name="/local"
fi
else
volume_name="/local"
fi

PULP_URL="${PULP_URL:-http://localhost:24817}"

# Download the schema
Expand All @@ -34,7 +46,7 @@ fi
echo ::group::BINDINGS
if [ $2 = 'python' ]
then
$container_exec run -u $(id -u) --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.1 generate \
$container_exec run -u $(id -u) --rm -v ${PWD}:$volume_name openapitools/openapi-generator-cli:v4.3.1 generate \
-i /local/api.json \
-g python \
-o /local/$1-client \
Expand All @@ -48,7 +60,7 @@ fi
if [ $2 = 'ruby' ]
then
python3 remove-cookie-auth.py
$container_exec run -u $(id -u) --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.1 generate \
$container_exec run -u $(id -u) --rm -v ${PWD}:$volume_name openapitools/openapi-generator-cli:v4.3.1 generate \
-i /local/api.json \
-g ruby \
-o /local/$1-client \
Expand All @@ -60,10 +72,11 @@ then
fi
if [ $2 = 'typescript' ]
then
$container_exec run -u $(id -u) --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v5.0.0 generate \
$container_exec run -u $(id -u) --rm -v ${PWD}:$volume_name openapitools/openapi-generator-cli:v5.2.1 generate \
-i /local/api.json \
-g typescript-axios \
-o /local/$1-client \
-t /local/templates/typescript-axios \
--skip-validate-spec \
--strict-spec=false
fi
Expand Down
Loading

0 comments on commit 48235a6

Please sign in to comment.