required-api-key-authorization-key-name
Overview
This rule belongs to the swagger-v1-validation ruleset and states that:
If the authorization type is API Key (i.e. type is set to apiKey), the Authorization Object must specify a name for the API Key parameter, using the keyname property. If a name is not provided, apiKey will be assumed by default automatically during import/transformations into APIMatic.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Required property keyname in API key Authorization Object is missing. |
| Code | SWAGGER1_V403 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Authorizations |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | swagger1 swagger semantic validation keyname api key type authorization |
Suggested Fixes
- Add missing
keynameproperty in the Authorization Object. - Make sure that the
keynameproperty is not null or empty. - Ensure that the name you provide as
keynamematches exactly with one expected to be sent for the API key when authorizing an API request. - Choose a different authorization type if API key name is not applicable in your API authentication's case.