Skip to content

Commit

Permalink
fix: add support for dictionary (#43)
Browse files Browse the repository at this point in the history
Co-authored-by: afernand <[email protected]>
  • Loading branch information
laurasgkadri98 and AlejandroFernandezLuces authored Dec 20, 2024
1 parent 61f635e commit 42b4e7a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ jobs:
library-name: ${{ env.PACKAGE_NAME }}
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}
whitelist-license-check: "attrs" # This has MIT license but fails the check

mendscan-sca:
name: Mend Scan
runs-on: ubuntu-latest
Expand Down
4 changes: 4 additions & 0 deletions src/allie/flowkit/fastapi_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ def extract_field_type(field_info: dict):
"""
field_type = field_info.get("type", "Unknown")
if field_type == "object":
dict_field = field_info.get("additionalProperties", {})
dict_type = dict_field.get("type", "Unknown")
return f"dict[string][{dict_type}]"
if field_type == "array":
items = field_info.get("items", {})
item_type = extract_field_type(items)
Expand Down

0 comments on commit 42b4e7a

Please sign in to comment.