required-api-key-security-scheme-parameter-name
Overview
This rule belongs to the swagger-v2-standards-validation ruleset and states that:
If the security scheme type is API Key (i.e. type is set to apiKey), the Security Scheme Object must specify a name for the API Key parameter using the name property. If name information is not provided, apikey will be assumed by default automatically during import/transformations in APIMatic.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Required property name in API key Security Scheme Object is missing. |
| Code | SWAGGER20STANDARDS_V373 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Security Schemes |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | swagger2 swagger standards semantic validation name api key type security scheme security |
Suggested Fixes
- Add missing
nameproperty in the Security Scheme Object. - Make sure that the
nameproperty is not null or empty. - Choose a different security scheme type if API key name is not applicable in your API authentication's case.