sailpoint-oss / developer.sailpoint.com

The codebase that makes up developer.sailpoint.com, including developer documentation. This codebase is open source and welcomes contributions.
https://developer.sailpoint.com
MIT License
34 stars 85 forks source link

[Bug] OpenApi definition not valid #439

Open pearnaly opened 11 months ago

pearnaly commented 11 months ago

The OpenApi definition seems to have several errors

To Reproduce Steps to reproduce the behavior:

  1. Import OpenApi definition from https://developer.sailpoint.com/iiq/api/identityiq-scim-rest-api/ in Postman. You can review this ticket directly in the OpenApi file, but Postman is much easier. (Of course set-up the BasicAuth ahd baseUrl variables)

1.1. Try the GET LaunchedWorkflow endpoint (GET {{baseUrl}}/LaunchedWorkflow). 1.2. You get a 404 error. It's because the correct endpoint is {{baseUrl}}/LaunchedWorkflows with an "s" at the end

2.1 Try the POST LaunchedWorkflows endpoint. You have to edit the following provided template with your own data.

{
  "schemas": [
    {
      "example": [
        "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow",
        "urn:ietf:params:scim:schemas:sailpoint:1.0:TaskResult"
      ]
    },
    {
      "example": [
        "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow",
        "urn:ietf:params:scim:schemas:sailpoint:1.0:TaskResult"
      ]
    }
  ],
  "workflowName": "<string>",
  "input": [
    {
      "key": "<string>",
      "value": "<string>",
      "type": "<string>"
    },
    {
      "key": "<string>",
      "value": "<string>",
      "type": "<string>"
    }
  ]
}

2.2. You get a 404 error "Resource Workflow null not found.". it is because the correct template would be:

{
  "schemas": [
    "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow",
    "urn:ietf:params:scim:schemas:sailpoint:1.0:TaskResult"
  ],
  "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow": {
    "workflowName": "<string>",
    "input": [
      {
        "value": "<string>",
        "key": "<string>",
        "type": "<string>"
      },
      {
        "value": "<string>",
        "key": "<string>",
        "type": "<string>"
      }
    ]
  }
}

i.e. schemas as a list and not list of list and "urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow" wrapping level for the data.

2.3. Please note that I can live with a wrong template since I can replace it easilly. The problem is that the structural definition of the OpenApi file is also wrong and I cannot generate a correct client with OpenApiGenerator.

Operating System (please complete the following information):

Thank you!

pearnaly commented 11 months ago

aaaand i'm sorry it seems to be at least partially a duplicate of https://github.com/sailpoint-oss/developer.sailpoint.com/issues/429

pearnaly commented 11 months ago

Here is my change:

    post:
      ...
      requestBody:
        required: true
        content:
          application/scim+json:
            schema:
              properties:
                schemas:
                  type: array
                  description: Schemas related to Launched Workflows.
                  items:
                    type: string
                  example:
                    - 'urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow'
                    - 'urn:ietf:params:scim:schemas:sailpoint:1.0:TaskResult'
                urn:ietf:params:scim:schemas:sailpoint:1.0:LaunchedWorkflow:
                  type: object
                  properties:
                    workflowName:
                      type: string
                      description: Name of the Workflow to launch.
                      example: LCM Manage Passwords
                    input:
                    ...
pearnaly commented 11 months ago

ok it goes on... with other errors:

pearnaly commented 10 months ago

Please another point: The body return type of the 3 LaunchedWorkflow endpoints (get one, embedded object of get list, post one) should be exactly equal and point to a single object definition in the yaml.