Skip to content

Commit

Permalink
feat(api): added Java API client generation and updated package name …
Browse files Browse the repository at this point in the history
…for Python client

- Added a new task in Taskfile for automatic Java API client generation
- Updated the package name for the Python client generation
- Verified compatibility and correct API functionality
  • Loading branch information
gibiw committed Oct 31, 2024
1 parent 76ed14c commit e5c628b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
11 changes: 10 additions & 1 deletion testops-api/Taskfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,22 @@ function typescript() {
openapi generate -i /specs/src.yaml -g typescript-axios -t sdk/templates/axios -o sdk/ts -c sdk/ts.yml --inline-schema-options REFACTOR_ALLOF_INLINE_SCHEMAS=true --additional-properties=npmName=qaseio "${version}"
}

function java() {
local version=${1:-v1}

rm -rf "${version}/sdk/java"
mkdir -p "${version}/sdk/java"
cp "${version}/sdk/templates/java-openapi-generator-ignore" "${version}/sdk/python/.openapi-generator-ignore"
openapi generate -i /specs/src.yaml -g java -t sdk/templates -o sdk/java --additional-properties=apiPackage=io.qase.client.${version}.api --additional-properties=modelPackage=io.qase.client.${version}.models "${version}"
}

function python() {
local version=${1:-v1}

rm -rf "${version}/sdk/python"
mkdir -p "${version}/sdk/python"
cp "${version}/sdk/templates/python-openapi-generator-ignore" "${version}/sdk/python/.openapi-generator-ignore"
openapi generate -i /specs/src.yaml -g python -t sdk/templates -o sdk/python --additional-properties=packageName=qaseio "${version}"
openapi generate -i /specs/src.yaml -g python -t sdk/templates -o sdk/python --additional-properties=packageName=qase.api_client_${version} "${version}"
}

function openapi() {
Expand Down
2 changes: 2 additions & 0 deletions testops-api/v1/sdk/templates/java-openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git_push.sh
.travis.yml
2 changes: 2 additions & 0 deletions testops-api/v2/sdk/templates/java-openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
git_push.sh
.travis.yml

0 comments on commit e5c628b

Please sign in to comment.