Skip to content

Openapi for endpoints that have pagination end up with duplicate parameters #42

Open
@jeffory-orrok

Description

@jeffory-orrok

Here is a link to the openapi.json for Amazon Connect Service https://api.apis.guru/v2/specs/amazonaws.com/connect/2017-08-08/openapi.json

In the above file #/paths/~1contact-flows-summary~1{InstanceId}/get/parameters is

        "parameters": [
          {
            "description": "The identifier of the Amazon Connect instance.",
            "in": "path",
            "name": "InstanceId",
            "required": true,
            "schema": {
              "maxLength": 100,
              "minLength": 1,
              "type": "string"
            }
          },
          {
            "description": "The type of contact flow.",
            "in": "query",
            "name": "contactFlowTypes",
            "required": false,
            "schema": {
              "items": {
                "$ref": "#/components/schemas/ContactFlowType"
              },
              "maxItems": 10,
              "type": "array"
            }
          },
          {
            "description": "The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.",
            "in": "query",
            "name": "nextToken",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "The maximum number of results to return per page.",
            "in": "query",
            "name": "maxResults",
            "required": false,
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "description": "Pagination limit",
            "in": "query",
            "name": "MaxResults",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "description": "Pagination token",
            "in": "query",
            "name": "NextToken",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],

Note there is nextToken and NextToken, and maxResults and MaxResults. However, there are only four parameters in the API reference https://docs.aws.amazon.com/connect/latest/APIReference/API_ListContactFlows.html

I believe the problem stems from the existence of pagination functions in the SDK, e.g. aws-sdk-js-v3//clients/client-connect/pagination/ListContactFlowsPaginator.ts which are unioned with the clients e.g. aws-sdk-js-v3//clients/client-connect/commands/ListContactFlowsCommand.ts, resulting in the duplicate parameters. There are 186 directories named pagination within the entire corpus of the aws-sdk so this is potentially a massive issue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions