Key does not match the allowed pattern

Issue ID: v3-validation-key-pattern

Description

A key in a map you have defined does not match the regex defined for the components object. All keys must follow the regular expression ^[a-zA-Z0-9\.\-_]+$.

JSON and YAML both require that you escape \ characters. Remeber to use \\ instead of \ in all regular expressions.

For more details, see the OpenAPI Specification.

Example

The following is an example of how this issue could look in your API definition:

{
    "securitySchemes": {
        "api key": {
            "type": "apiKey",
            "name": "API key",
            "in": "header"
        }
    }
}

Remediation

Make sure that all keys match the regex allowed for the components object.

{
    "securitySchemes": {
        "api_key": {
            "type": "apiKey",
            "name": "API key",
            "in": "header"
        }
    }
}