Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jeffory-orrok opened this issue Mar 2, 2021 · 1 comment
Assignees
Labels

Comments

@jeffory-orrok
Copy link

jeffory-orrok commented Mar 2, 2021

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.

@MikeRalphson MikeRalphson self-assigned this Mar 3, 2021
@MikeRalphson
Copy link
Contributor

Thanks - will investigate. Presumably the parameters in the AWS .normal.json definition should be preferred to duplicates from the paginators file...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants