sailpoint-oss / python-sdk

MIT License
6 stars 3 forks source link

list_identity_profiles(): Unable to serialize unknown type: <class 'typing_extensions._LiteralGenericAlias'> #22

Closed scott-fehrman-sp closed 2 weeks ago

scott-fehrman-sp commented 2 months ago

run: python3 test_IdentityProfiles.py

code:

from typing import List
import sailpoint.v3
import sailpoint.beta
import json
from sailpoint.configuration import Configuration
from pydantic import StrictStr

configuration: Configuration = Configuration()
results: List[sailpoint.v3.IdentityProfile] = None
result: sailpoint.v3.IdentityProfile = None
data: str = None

with sailpoint.v3.ApiClient(configuration) as api_client:
    results = sailpoint.v3.IdentityProfilesApi(api_client).list_identity_profiles()
    result = results[0]
    data = result.model_dump_json(by_alias=True, indent=4) # ERROR
    print(data)

Output:

Unable to serialize unknown type: <class 'typing_extensions._LiteralGenericAlias'>
  File "test_IdentityProfiles.py", line 16, in <module>
    data = result.model_dump_json(by_alias=True, indent=4)
pydantic_core._pydantic_core.PydanticSerializationError: 
Unable to serialize unknown type: <class 'typing_extensions._LiteralGenericAlias'>
tyler-mairose-sp commented 2 weeks ago

This is solved in https://github.com/sailpoint-oss/python-sdk/commit/3d9dc381e364df0db8b2fc68615c1cb505e898a5 and will be in the next release. If you continue to see issues, please re-open this issue.