Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

"Duplicate parameter name found in the endpoint" errors on v3.1 definition (parameters 'list_id', 'segment_id', 'recipient_id') #121

Open
julealgon opened this issue Dec 14, 2023 · 1 comment

Comments

@julealgon
Copy link

Issue Summary

When running validation from ApiMatic, several 'duplicate parameter name' errors are thrown:

Duplicate parameter name found in the endpoint. ([View Details](https://docs.apimatic.io/rulesets/apimatic-codegen-validation/unique-endpoint-parameter-name))
Source: API > Endpoints > Contacts API - Lists[3] > GET_contactdb-lists-list_id [GET, /v3/contactdb/lists/{list_id}] > Parameters[1] > list_id.
Duplicate Parameter Name: list_id
Endpoint Name: GET_contactdb-lists-list_id.

Duplicate parameter name found in the endpoint. ([View Details](https://docs.apimatic.io/rulesets/apimatic-codegen-validation/unique-endpoint-parameter-name))
Source: API > Endpoints > Contacts API - Lists[4] > PATCH_contactdb-lists-list_id [PATCH, /v3/contactdb/lists/{list_id}] > Parameters[1] > list_id.
Duplicate Parameter Name: list_id
Endpoint Name: PATCH_contactdb-lists-list_id.

Duplicate parameter name found in the endpoint. ([View Details](https://docs.apimatic.io/rulesets/apimatic-codegen-validation/unique-endpoint-parameter-name))
Source: API > Endpoints > Contacts API - Lists[6] > GET_contactdb-lists-list_id-recipients [GET, /v3/contactdb/lists/{list_id}/recipients] > Parameters[1] > list_id.
Duplicate Parameter Name: list_id
Endpoint Name: GET_contactdb-lists-list_id-recipients.

Duplicate parameter name found in the endpoint. ([View Details](https://docs.apimatic.io/rulesets/apimatic-codegen-validation/unique-endpoint-parameter-name))
Source: API > Endpoints > Contacts API - Lists[9] > DELETE_contactdb-lists-list_id-recipients-recipient_id [DELETE, /v3/contactdb/lists/{list_id}/recipients/{recipient_id}] > Parameters[1] > list_id.
Duplicate Parameter Name: list_id
Endpoint Name: DELETE_contactdb-lists-list_id-recipients-recipient_id.

Duplicate parameter name found in the endpoint. ([View Details](https://docs.apimatic.io/rulesets/apimatic-codegen-validation/unique-endpoint-parameter-name))
Source: API > Endpoints > Contacts API - Lists[9] > DELETE_contactdb-lists-list_id-recipients-recipient_id [DELETE, /v3/contactdb/lists/{list_id}/recipients/{recipient_id}] > Parameters[3] > recipient_id.
Duplicate Parameter Name: recipient_id
Endpoint Name: DELETE_contactdb-lists-list_id-recipients-recipient_id.

Duplicate parameter name found in the endpoint. ([View Details](https://docs.apimatic.io/rulesets/apimatic-codegen-validation/unique-endpoint-parameter-name))
Source: API > Endpoints > Contacts API - Segments[2] > GET_contactdb-segments-segment_id [GET, /v3/contactdb/segments/{segment_id}] > Parameters[1] > segment_id.
Duplicate Parameter Name: segment_id
Endpoint Name: GET_contactdb-segments-segment_id.

Duplicate parameter name found in the endpoint. ([View Details](https://docs.apimatic.io/rulesets/apimatic-codegen-validation/unique-endpoint-parameter-name))
Source: API > Endpoints > Contacts API - Segments[3] > PATCH_contactdb-segments-segment_id [PATCH, /v3/contactdb/segments/{segment_id}] > Parameters[2] > segment_id.
Duplicate Parameter Name: segment_id
Endpoint Name: PATCH_contactdb-segments-segment_id.

All of these errors occur for parameters that are present both as a segment, as well as a query string parameter. For example, from https://raw.githubusercontent.com/sendgrid/sendgrid-oai/main/spec/paths/legacy_marketing_campaigns/contacts_api_lists.json

image

Notice the first "global" parameter called list_id used as a path value, and then, on the GET definition, there is another instance of parameter list_id, but now from the query area.

The exact same issue exists for the other errors above: a global segment parameter is redefined as a specific query parameter in the individual endpoints.

Here are the 2 places in the example above:

{
"name": "list_id",
"in": "path",
"required": true,
"schema": {
"type": "string"
}
}

{
"name": "list_id",
"in": "query",
"description": "The ID of the list to retrieve.",
"schema": {
"type": "integer"
}
},

These errors prevent us from loading the definition in ApiMatic and converting it to v3.0, which is a requirement for us since our client generation tool doesn't support v3.1 OpenAPI definition files.

Could this be fixed in the source, so that the same parameter name is not used across multiple areas?

Copy link

Ahoy! Thank you for opening your first issue here! If this request is regarding troubleshooting your application, please reach out to the support team via https://support.twilio.com. Please note that this repo accepts Issues; however external Pull Requests cannot be accepted because the code is generated using Twilio SendGrid's tooling.

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

No branches or pull requests

1 participant