sailpoint-oss / python-sdk

MIT License
6 stars 3 forks source link

[BUG]: WorkflowsAPI get_workflow_execution_history, traceback on incorrect type. #13

Closed rob-buskens-sp closed 3 months ago

rob-buskens-sp commented 6 months ago

Error on the sailpoint.v3.WorkflowsApi(v3_client).get_workflow_execution_history method.

Sample code

    with sailpoint.v3.ApiClient(configuration) as v3_client, \
        sailpoint.beta.ApiClient(configuration) as beta_client:

        workflow_executions = sailpoint.v3.WorkflowsApi(v3_client).list_workflow_executions(id = '58417085-af78-4723-990a-87f0f1e939e9')

        for workflow_execution in workflow_executions:

            workflow_execution_history_events = sailpoint.v3.WorkflowsApi(v3_client).get_workflow_execution_history(id = workflow_execution.id)

            for event in workflow_execution_history_events:
                print(event)

Results in:

Exception has occurred: ValidationError
1 validation error for WorkflowExecutionEvent
type
  Input should be a valid dictionary [type=dict_type, input_value='WorkflowExecutionStarted', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/dict_type
  File "/Users/rob.buskens/Documents/Code/workflows/workflow.py", line 41, in <module>
    workflow_execution_history = sailpoint.v3.WorkflowsApi(v3_client).get_workflow_execution_history(id = workflow_execution.id)
pydantic_core._pydantic_core.ValidationError: 1 validation error for WorkflowExecutionEvent
type
  Input should be a valid dictionary [type=dict_type, input_value='WorkflowExecutionStarted', input_type=str]
    For further information visit https://errors.pydantic.dev/2.7/v/dict_type

Exception has occurred: ValidationError 1 validation error for WorkflowExecutionEvent type Input should be a valid dictionary [type=dict_type, input_value='WorkflowExecutionStarted', input_type=str] For further information visit https://errors.pydantic.dev/2.7/v/dict_type File "/Users/rob.buskens/Documents/Code/workflows/workflow.py", line 41, in workflow_execution_history_events = sailpoint.v3.WorkflowsApi(v3_client).get_workflow_execution_history(id = workflow_execution.id) pydantic_core._pydantic_core.ValidationError: 1 validation error for WorkflowExecutionEvent type Input should be a valid dictionary [type=dict_type, input_value='WorkflowExecutionStarted', input_type=str] For further information visit https://errors.pydantic.dev/2.7/v/dict_type

rob-buskens-sp commented 6 months ago

The yaml for WorkFlowExecutionEvent has errors in it. The code above runs if the following changes are made and the python sdk is rebuilt.

https://github.com/sailpoint-oss/api-specs/pull/72

tyler-mairose-sp commented 3 months ago

Hey @rob-buskens-sp, this is fixed in https://github.com/sailpoint-oss/python-sdk/commit/b9a258c430dedf7c1e7937e180393f8087b55eab and will be included in the next release.