Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
15 changes: 9 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,28 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'

openapi_python_client_version=$1
openapi_file_path=$2
openapi_url=$3
config_file_path=$4

if [[ "$openapi_python_client_version" != "NOT_SPECIFIED" ]]; then
version_arg="--spec openapi-python-client==${openapi_python_client_version}"
version_arg="openapi-python-client==${openapi_python_client_version}"
else
version_arg=""
version_arg="openapi-python-client"
fi

if [[ "$config_file_path" != "NOT_SPECIFIED" ]]; then
config_arg="--config ${config_file_path}"
config_arg="--config=${config_file_path}"
else
config_arg=""
fi

openapi_document_path_or_url_arg="--path ${openapi_file_path}"
openapi_document_path_or_url_arg="--path=${openapi_file_path}"
if [[ "$openapi_url" != "NOT_SPECIFIED" ]]; then
openapi_document_path_or_url_arg="--url ${openapi_url}"
openapi_document_path_or_url_arg="--url=${openapi_url}"
fi

pipx run ${version_arg} openapi-python-client generate ${config_arg} ${openapi_document_path_or_url_arg}
pipx install "${version_arg}" --include-deps
openapi-python-client generate ${config_arg} ${openapi_document_path_or_url_arg}