@@ -66,33 +66,35 @@ jobs:
6666 # You can list available versions with: openapi-generator-cli version-manager list
6767 openapi-generator-cli version-manager set 7.5.0 # Example: Set to a specific stable version
6868
69- - name : Generate Python SDK
69+ - name : Generate SDKs
7070 run : |
7171 set -e # Exit immediately if a command exits with a non-zero status.
7272
73- echo "Generating Python SDK for finfeedapi/sec-api/spec/sec-api-historical.yaml "
74- # Define output directory
73+ echo "Generating SDKs using configurations in finfeedapi/sec-api/sdk-config/ "
74+ # Define base output directory for all SDKs
7575 SDK_OUTPUT_DIR="finfeedapi/sec-api/sdk"
7676
77- # Create the output directory if it doesn't exist
77+ # Create the base output directory if it doesn't exist
7878 mkdir -p "${SDK_OUTPUT_DIR}"
7979
80- # It's a good practice to clear the SDK directory before generation
81- # to ensure no stale files are left if the generator doesn't clean up.
82- # Be careful with 'rm -rf' - ensure the path is correct.
83- # Consider if your generator has a 'clean' option.
84- # If the generator overwrites and removes old files, this might not be strictly necessary .
85- echo "Cleaning previous SDK (if any) from ${SDK_OUTPUT_DIR}..."
80+ # Clean the base SDK directory before generation.
81+ # This ensures no stale files are left. The batch process, guided by
82+ # the config files, should then create language-specific subdirectories
83+ # (e.g., ${SDK_OUTPUT_DIR}/python, ${SDK_OUTPUT_DIR}/java)
84+ # within this cleaned directory .
85+ echo "Cleaning previous SDKs (if any) from ${SDK_OUTPUT_DIR}..."
8686 rm -rf "${SDK_OUTPUT_DIR:?}"/* # The :? ensures the variable is set, preventing accidental deletion of root if empty
8787
88- openapi-generator-cli generate \
89- -i finfeedapi/sec-api/spec/sec-api-historical.yaml \
90- -g python \
91- -o "${SDK_OUTPUT_DIR}" \
92- --additional-properties=packageName=sec_api_historical_sdk,projectName=sec-api-historical-sdk \
93- -v # Verbose output
88+ # IMPORTANT: Ensure your *.yaml config files in finfeedapi/sec-api/sdk-config/
89+ # have their 'outputDir' property correctly set to create language-specific
90+ # subdirectories under "${SDK_OUTPUT_DIR}".
91+ # For example, a config file 'sdk-config/python.yaml' should specify an
92+ # outputDir like '../sdk/python' (relative to the config file) or
93+ # an absolute path like '${{ github.workspace }}/finfeedapi/sec-api/sdk/python'.
94+ echo "Running OpenAPI Generator CLI batch process..."
95+ openapi-generator-cli batch finfeedapi/sec-api/sdk-config/*.yaml -v
9496
95- echo "SDK generation complete."
97+ echo "SDKs generation complete."
9698
9799 - name : Commit and Push SDK
98100 # Only run this step for push events to the specified branch
0 commit comments