Skip to content
Open
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
28 changes: 25 additions & 3 deletions generate_client.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
docker run --rm -v "${PWD}:/local" openapitools/openapi-generator-cli generate \
-i https://arcane.engineer/api/openapi.yaml \
#!/bin/bash

# This script generates a Python client from the OpenAPI specification.
# It uses the openapitools/openapi-generator-cli Docker image to perform the generation.

# Exit immediately if a command exits with a non-zero status.
set -e

# Define the OpenAPI specification URL
OPENAPI_SPEC_URL="https://arcane.engineer/api/openapi.yaml"

# Define the output directory
OUTPUT_DIR="/local"

# Run the OpenAPI Generator CLI Docker container
# - --rm: Automatically remove the container when it exits
# - -v "${PWD}:/local": Bind mount the current directory to /local in the container
# - -i: Input OpenAPI specification URL
# - -g: Generator name (python)
# - --additional-properties: Additional properties for the generator
# - -o: Output directory

docker run --rm -v "${PWD}:${OUTPUT_DIR}" openapitools/openapi-generator-cli generate \
-i ${OPENAPI_SPEC_URL} \
-g python \
--additional-properties generateSourceCodeOnly=true,projectName=arcane-engine,packageName=arcane \
-o /local
-o ${OUTPUT_DIR}