sailpoint-oss / api-specs

This repo houses the API specifications for all SailPoint services.
MIT License
10 stars 17 forks source link

completionStatus strings are not uppercase #70

Closed yannick-beot-sp closed 1 month ago

yannick-beot-sp commented 5 months ago

According to idn/beta/schemas/TaskStatus.yaml, task's completionStatus can be Success, Warning, Error, Terminated, TempError:

  completionStatus:
    description: Completion status of the task this TaskStatus represents
    type: string
    enum:
      - Success
      - Warning
      - Error
      - Terminated
      - TempError
    example: Success

However, in reality, the status are in uppercase:

For instance:

{
    "id": "7b55b749a7c34b8a98ccfda49b986767",
    "type": "QUARTZ",
    "uniqueName": "Entitlement Source Reset - eebd371d-d8af-4575-a6de-3bebfdd79c87",
    "description": "Resets entitlements on a specific source",
    "parentName": null,
    "launcher": "System",
    "target": null,
    "created": "2024-04-22T09:30:25.012Z",
    "modified": "2024-04-22T09:30:27.352Z",
    "launched": null,
    "completed": "2024-04-22T09:30:27.236Z",
    "taskDefinitionSummary": {
        "id": "e646c97e67dc4c298ad60a39716357bf",
        "uniqueName": "Entitlement Source Reset",
        "description": "Resets entitlements on a specific source",
        "parentName": "Entitlement Source Reset",
        "executor": "sailpoint.task.ServiceTaskExecutor",
        "arguments": {
            "serviceClass": "com.sailpoint.governance.entitlement.message.SourceDeleteMessageHandler",
            "serviceMethod": "handleMessage"
        }
    },
    "completionStatus": "SUCCESS",
    "messages": [],
    "returns": [
        {
            "name": "TASK_OUT_ENTITLEMENTS_DELETED",
            "attributeName": "entitlementsDeleted"
        }
    ],
    "attributes": {
        "EntitlementsDeleted": 200,
        "qpocJobId": "28a9bad0-66c9-4ec0-8df8-389e941b27cf"
    },
    "progress": null,
    "percentComplete": 0
}

It is also the same for ERROR, WARNING, etc. Underlying generated code (for instance, typescript SDK is not doing a good job at comparing the values because, it is expecting "Success" instead of "SUCCESS" and it is not the same.

Therefore, the simple code below is not working as expected:

//task.completionStatus  = 'SUCCESS'
if (task.completionStatus === TaskStatusBetaCompletionStatusEnum.Success) {
                    ...
}

image

tyler-mairose-sp commented 1 month ago

Hey @yannick-beot-sp, thanks for pointing this out. This was fixed in this commit: https://github.com/sailpoint-oss/api-specs/commit/4ea6ac0386b6ee8965bbe6d721f43237e580cecd#diff-7877df4cb4b9778ecdf952bc3608e64143d3f947d048b1e98392462b2f19e026