unique-operation-parameter
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
The parameters list provided using the parameters
property in the Operation Object must not include any duplicate parameter definitions. A unique parameter is defined by a combination of its name and location.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Duplicate entry found for parameter in the current Operation Object parameters. |
Code | OPENAPI3STANDARDS_V052 |
Type | Validation |
Rule System | Semantic |
Broad Category | Operations |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation parameters parameter name location operation |
Suggested Fixes
- Remove duplicate entry of a parameter from the parameters list.
- If name and location of a parameter matches with that of some other parameter entry, remove one of such entries.
- Parameter names are compared in a case-sensitive manner.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#operation-object:~:text=never%20remove%20it.-,The%20list%20MUST%20NOT%20include%20duplicated%20parameters.%20A%20unique%20parameter%20is%20defined%20by%20a%20combination%20of%20a%20name%20and%20location,-.%20The%20list%20can
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterName
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#parameterIn
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#operationObject:~:text=never%20remove%20it.-,The%20list%20MUST%20NOT%20include%20duplicated%20parameters.%20A%20unique%20parameter%20is%20defined%20by%20a%20combination%20of%20a%20name%20and%20location,-.%20The%20list%20can
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameterName
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#parameterIn
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/