You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
According to the OpenAPI Specification regarding Operation Parameters:
"A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters."
However the "path-params" rule incorrectly identifies the scenario where the parameter definition exists both at the path and the operation level as a duplicate instead of a valid override.
Disabling the "path-params" rule is not a suitable long-term workaround because the rule does provide valuable validation to identify duplication scenarios where the same path parameter name is defined twice within the same parameter list at either the path or operation level.
To Reproduce
The following test could be added to oasPathParam.test.ts to demonstrate the failure.
Describe the bug
According to the OpenAPI Specification regarding Operation Parameters:
"A list of parameters that are applicable for this operation. If a parameter is already defined at the Path Item, the new definition will override it but can never remove it. The list MUST NOT include duplicated parameters."
However the "path-params" rule incorrectly identifies the scenario where the parameter definition exists both at the path and the operation level as a duplicate instead of a valid override.
Disabling the "path-params" rule is not a suitable long-term workaround because the rule does provide valuable validation to identify duplication scenarios where the same path parameter name is defined twice within the same parameter list at either the path or operation level.
To Reproduce
The following test could be added to oasPathParam.test.ts to demonstrate the failure.
Expected behavior
Spectral should not produce a lint error when a valid parameter override exists in the API definition.
The text was updated successfully, but these errors were encountered: