Skip to content

Commit fddb1ff

Browse files
committed
fix
1 parent 40dcbad commit fddb1ff

File tree

3 files changed

+4
-34
lines changed

3 files changed

+4
-34
lines changed

.github/workflows/generate-sec-api-python-sdk.yaml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on:
55
branches:
66
- master # Adjust to your default branch (e.g., main) if different
77
paths:
8-
- 'finfeedapi/sec-api/spec/sec-api-historical.yaml'
8+
- 'finfeedapi/sec-api/spec/sec-api-historical.json'
99
pull_request:
1010
branches:
1111
- master # Adjust to your default branch (e.g., main) if different
1212
paths:
13-
- 'finfeedapi/sec-api/spec/sec-api-historical.yaml'
13+
- 'finfeedapi/sec-api/spec/sec-api-historical.json'
1414

1515
jobs:
1616
build-and-commit-sdk:
@@ -66,36 +66,6 @@ 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: Prepare OpenAPI Spec for Generator
70-
run: |
71-
echo "Original spec file: finfeedapi/sec-api/spec/sec-api-historical.yaml"
72-
NEW_SPEC_FILE_PATH="finfeedapi/sec-api/spec/sec-api-historical.json"
73-
OLD_SPEC_FILE_NAME="sec-api-historical.yaml"
74-
NEW_SPEC_FILE_NAME="sec-api-historical.json"
75-
76-
# Rename the spec file to .json to ensure correct parsing
77-
if [ -f "finfeedapi/sec-api/spec/${OLD_SPEC_FILE_NAME}" ]; then
78-
echo "Renaming finfeedapi/sec-api/spec/${OLD_SPEC_FILE_NAME} to ${NEW_SPEC_FILE_PATH}"
79-
mv "finfeedapi/sec-api/spec/${OLD_SPEC_FILE_NAME}" "${NEW_SPEC_FILE_PATH}"
80-
else
81-
echo "Warning: Expected spec file finfeedapi/sec-api/spec/${OLD_SPEC_FILE_NAME} not found. Assuming it might have been already renamed or path is incorrect."
82-
# If the .json file already exists, we assume it's the correct one
83-
if [ ! -f "${NEW_SPEC_FILE_PATH}" ]; then
84-
echo "Error: Neither ${OLD_SPEC_FILE_NAME} nor ${NEW_SPEC_FILE_NAME} found in spec directory. Cannot proceed."
85-
exit 1
86-
fi
87-
fi
88-
89-
echo "Updating inputSpec in generator config files to point to ${NEW_SPEC_FILE_NAME}..."
90-
CONFIG_DIR="finfeedapi/sec-api/sdk-config"
91-
find "${CONFIG_DIR}" -type f -name '*.yaml' -print0 | while IFS= read -r -d $'\\0' configFile; do
92-
echo "Processing ${configFile}..."
93-
# Using a temporary file for sed to ensure compatibility, especially with -i
94-
sed "s|\\(inputSpec:.*\\)${OLD_SPEC_FILE_NAME}|\\1${NEW_SPEC_FILE_NAME}|g" "${configFile}" > "${configFile}.tmp" && mv "${configFile}.tmp" "${configFile}"
95-
echo "Updated inputSpec in ${configFile} if necessary."
96-
done
97-
echo "Finished preparing OpenAPI spec and config files."
98-
9969
- name: Generate SDKs
10070
run: |
10171
set -e # Exit immediately if a command exits with a non-zero status.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
inputSpec: "./openapi/ems-cloud-mgmt-rest-v1.yaml"
1+
inputSpec: "./finfeedapi/sec-api/spec/sec-api-historical.json"
22
additionalProperties:
33
x-ext-name: "Tomasz Przybysz"

finfeedapi/sec-api/spec/sec-api-historical.yaml renamed to finfeedapi/sec-api/spec/sec-api-historical.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"openapi": "3.0.1",
33
"info": {
4-
"title": "REST API",
4+
"title": "REST API",
55
"contact": {
66
"name": "API BRICKS LTD",
77
"url": "https://www.finfeedapi.com",

0 commit comments

Comments
 (0)