Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2bb5c4d
try
catalinsymphony Aug 18, 2025
89bab1f
regenerate
catalinsymphony Aug 18, 2025
427e034
Added script and new generator
catalinsymphony Aug 19, 2025
6a83532
Fix unittests on auth
catalinsymphony Aug 19, 2025
208b921
Fix unittests on application service
catalinsymphony Aug 19, 2025
586b0a1
Fix unittests on application service
catalinsymphony Aug 19, 2025
5303106
Fix unittests on signal and presence service
catalinsymphony Aug 20, 2025
660f164
Fix unittests on connection and message service
catalinsymphony Aug 20, 2025
682e406
Fix unittests on api_client_factory and stream services
catalinsymphony Aug 21, 2025
703e089
Fix unittests on group .. still need attention
catalinsymphony Aug 21, 2025
659bde7
Fix unittests on message service ... added new multi_attachment api
catalinsymphony Aug 22, 2025
c1244d1
Formatted code
catalinsymphony Aug 22, 2025
8d36465
New generated api_client
catalinsymphony Aug 25, 2025
5b97252
Update the generation script and init
catalinsymphony Aug 25, 2025
e3c6750
small fixes
catalinsymphony Aug 25, 2025
073c8c0
Headers index seems to be changed
catalinsymphony Aug 25, 2025
72e4187
Small fixes for user service
catalinsymphony Aug 26, 2025
b7b2b49
Fix tests
catalinsymphony Aug 26, 2025
980e55e
Check if config was async
catalinsymphony Aug 27, 2025
168d61f
Fix multi part request
catalinsymphony Aug 28, 2025
45e7554
generate using 7.14
catalinsymphony Aug 28, 2025
d7cd59d
Removed url_safe function
catalinsymphony Aug 28, 2025
74be6aa
Fix tests
catalinsymphony Aug 29, 2025
60e7ba4
Remove test for pool_manager .. now it's initiated at use
catalinsymphony Aug 29, 2025
a80fa9e
Fix lint errors
catalinsymphony Aug 29, 2025
990d886
Update readme
catalinsymphony Sep 1, 2025
95e491f
Add typer to pyproject
catalinsymphony Sep 1, 2025
2c49c90
Update cve scan command
catalinsymphony Sep 1, 2025
b9b24f1
Revert "Update cve scan command"
catalinsymphony Sep 2, 2025
e87fde7
Revert "Add typer to pyproject"
catalinsymphony Sep 2, 2025
59bb9b6
Update build
catalinsymphony Sep 2, 2025
b0e3a2b
Update build release
catalinsymphony Sep 2, 2025
a70c973
CAIP-119 Fix datahose loop (#376)
catalinsymphony Sep 3, 2025
80004b5
Merge branch 'main' into new-generator
catalinsymphony Sep 4, 2025
79d5492
Add version
catalinsymphony Sep 5, 2025
2f72eb0
Generate code using latest commit available
catalinsymphony Sep 9, 2025
bb66c3b
Update to latest version of specs (without form values changes)
catalinsymphony Oct 13, 2025
2133911
Update version to beta
catalinsymphony Oct 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:
branches: [ "main", "*-rc" ]
pull_request:
branches: [ "main", "*-rc" ]
branches: [ "main", "*-rc", "release/3.x" ]

jobs:
build:
Expand Down
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,31 @@ _NOTE:_ Ensure you have an active Individual Contributor License Agreement (ICLA

For further inquiries, email [help@finos.org](mailto:help@finos.org).


### Updating Generated Code

Python BDK uses [OpenAPITools/openapi-generator](https://github.com/OpenAPITools/openapi-generator/) to generate code.
To update the generated code, follow these steps:

1. Download desired version of openapi generator.
```bash
cd api_client_generation
curl -L https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/7.14.0/openapi-generator-cli-7.14.0.jar -o openapi-generator-cli.jar
```
2. Adjust the commit for which the code is generated(inside generate.sh script)
3. Execute the generation script:
```bash
./generate.sh
```
4. Commit and push the newly generated code along with the updated JAR file.

Note: There are a few files that are not replaced(EX. api_client.py), those files require some modifications after code is generated.


### OLD Updating Generated Code (Deprecated)

Python BDK uses [OpenAPITools/openapi-generator](https://github.com/OpenAPITools/openapi-generator/) to generate code.
To update the generated code, follow these steps:

1. Checkout the latest branch of the fork (e.g., [sym-python-5.5.0](https://github.com/SymphonyPlatformSolutions/openapi-generator/tree/sym-python-5.5.0)).
2. Update the fork source code, review, and merge it.
3. Generate the JAR file in `openapi-generatormodules/openapi-generator-cli/target/openapi-generator-cli.jar`:
Expand Down
159 changes: 90 additions & 69 deletions api_client_generation/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,92 +4,113 @@ code_gen_dir=`pwd`
project_root=$code_gen_dir/..
echo $code_gen_dir

commit_hash=b63d67cc0ed7c5a3962e72f21001df4d2ed482f2
commit_hash=64977061b376680aaf09b088877bcaa9c3acc6a8
api_spec_base_url=https://raw.githubusercontent.com/symphonyoss/symphony-api-spec/${commit_hash}
echo $api_spec_base_url

#local_api_spec_base_url=./local

# This function accepts the following parameters (in order):
# - name of the module we want to generate
# - uri of the file to be used for generation
# - uri of the support file needed for the generation
download_and_generate_files() {
name=$1
file_url=$2
file_name=${file_url##*/}
support_file_url=$3
support_file_name=${support_file_url##*/}

download_files ${file_url} ${file_name} ${support_file_url} ${support_file_name}
generate_files ${name} ${file_name}
cleanup_files ${file_name} ${support_file_name}
name=$1
file_url=$2
file_name=${file_url##*/}
support_file_url=$3
support_file_name=${support_file_url##*/}

download_files "${file_url}" "${file_name}" "${support_file_url}" "${support_file_name}"
generate_files "${name}" "${file_name}"
cleanup_files "${file_name}" "${support_file_name}"
}

download_files() {
# download files
file_url=$1
file_name=$2
support_file_url=$3
support_file_name=$4

cd $code_gen_dir
curl $file_url -o $file_name
if [ ! -z "${support_file_name}" ]
then
curl $support_file_url -o $support_file_name
fi
file_url=$1
file_name=$2
support_file_url=$3
support_file_name=$4

cd "$code_gen_dir"
curl -s "$file_url" -o "$file_name"
if [ -n "$support_file_name" ]; then
curl -s "$support_file_url" -o "$support_file_name"
fi
}

generate_files() {

name=$1
file_name=$2

# generate files
java -jar openapi-generator-cli.jar generate -g python -i $file_name --package-name symphony.bdk.gen -o output

# update api files
cd $code_gen_dir/output/symphony/bdk/gen/api/
sed -i "s/symphony\.bdk\.gen\.model\./symphony\.bdk\.gen\.${name}_model\./g" *.py
sed -i "s/ api\./ ${name}_api\./g" *.py
rm __init__.py # we don't care about __init__.py files
cp *.py $project_root/symphony/bdk/gen/${name}_api

# update model files
cd $code_gen_dir/output/symphony/bdk/gen/model/
sed -i "s/symphony\.bdk\.gen\.model\./symphony\.bdk\.gen\.${name}_model\./g" *.py
sed -i "s/model /${name}_model /g" *.py
rm __init__.py # we don't care about __init__.py files
cp *.py $project_root/symphony/bdk/gen/${name}_model

# update rest.py
cd $code_gen_dir/output/symphony/bdk/gen
cp rest.py $project_root/symphony/bdk/gen/rest.py

cd $code_gen_dir
rm -r output
name=$1
file_name=$2

# Generate files
java -jar openapi-generator-cli.jar generate -g python -i "$file_name" --library asyncio --package-name symphony.bdk.gen -o output

# Define source and destination directories
new_api_dir="$code_gen_dir/output/symphony/bdk/gen/api/"
new_models_dir="$code_gen_dir/output/symphony/bdk/gen/models/"
final_models_dir="$project_root/symphony/bdk/gen/${name}_model/"
final_api_dir="$project_root/symphony/bdk/gen/${name}_api/"
final_main_models_dir="$project_root/symphony/bdk/gen/models/"

# Update and copy API files
echo "Updating and copying API files..."
mkdir -p "$final_api_dir"
cd "$new_api_dir"
sed -i "s/symphony\.bdk\.gen\.models\./symphony\.bdk\.gen\.${name}_model\./g" *.py
sed -i "s/ api\./ ${name}_api\./g" *.py
rm __init__.py
cp *.py "$final_api_dir"

# Update and copy model files
echo "Updating and copying Model files..."
mkdir -p "$final_models_dir"
cd "$new_models_dir"
# Capture the imports from the generated __init__.py before removing it
# Use awk to filter out comments and empty lines and then sed to replace the import path
awk '/^from symphony\.bdk\.gen\.models\./' __init__.py | sed "s/symphony\.bdk\.gen\.models\./symphony\.bdk\.gen\.${name}_model\./" >> "$final_main_models_dir/__init__.py"
sed -i "s/symphony\.bdk\.gen\.models\./symphony\.bdk\.gen\.${name}_model\./g" *.py
rm __init__.py

# Copy the actual model files
cp *.py "$final_models_dir"

# The rest of the files
# Here we have more files generated that are not updated because they require changes(EX. api_client)
cd "$code_gen_dir/output/symphony/bdk/gen"
cp rest.py "$project_root/symphony/bdk/gen/rest.py"

# Clean up
cd "$code_gen_dir"
rm -r output
}

cleanup_files() {
file_name=$1
support_file_name=$2

# remove downloaded files
cd $code_gen_dir
rm -r output
rm $file_name
if [ ! -z "${support_file_name}" ]
then
rm $support_file_name
fi
file_name=$1
support_file_name=$2

# remove downloaded files
cd "$code_gen_dir"
rm "$file_name"
if [ -n "$support_file_name" ]; then
rm "$support_file_name"
fi
}

main() {
# Prepare the target directory for the models
rm -rf "$project_root/symphony/bdk/gen/models"
mkdir -p "$project_root/symphony/bdk/gen/models"

# Add initial header to the main __init__.py
echo "# coding: utf-8" > "$project_root/symphony/bdk/gen/models/__init__.py"
echo "" >> "$project_root/symphony/bdk/gen/models/__init__.py"
echo "# This file is auto-generated by a script. Do not edit manually." >> "$project_root/symphony/bdk/gen/models/__init__.py"
echo "" >> "$project_root/symphony/bdk/gen/models/__init__.py"

download_and_generate_files agent "${api_spec_base_url}/agent/agent-api-public-deprecated.yaml"
download_and_generate_files auth "${api_spec_base_url}/authenticator/authenticator-api-public-deprecated.yaml"
download_and_generate_files login "${api_spec_base_url}/login/login-api-public.yaml"
download_and_generate_files pod "${api_spec_base_url}/pod/pod-api-public.yaml"
download_and_generate_files group "${api_spec_base_url}/profile-manager/profile-manager-api.yaml" "${api_spec_base_url}/profile-manager/symphony-common-definitions.yaml"
}

generate_files agent ${api_spec_base_url}/agent/agent-api-public-deprecated.yaml
generate_files auth ${api_spec_base_url}/authenticator/authenticator-api-public-deprecated.yaml
generate_files login ${api_spec_base_url}/login/login-api-public.yaml
generate_files pod ${api_spec_base_url}/pod/pod-api-public.yaml
generate_files group ${api_spec_base_url}/profile-manager/profile-manager-api.yaml ${api_spec_base_url}/profile-manager/symphony-common-definitions.yaml

#generate_files agent ${local_api_spec_base_url}/agent-api-public-deprecated-formValues-modified.yaml
main
Binary file modified api_client_generation/openapi-generator-cli.jar
Binary file not shown.
Loading
Loading