| slug | /docs/cli/rules/oas/spec-components-invalid-map-name |
|---|
Requires that specific objects inside components MUST use keys that match the regular expression: ^[a-zA-Z0-9\.\-_]+$.
| OAS | Compatibility |
|---|---|
| 2.0 | ❌ |
| 3.0 | ✅ |
| 3.1 | ✅ |
| 3.2 | ✅ |
flowchart TD
Root ==> Components --> NamedExamples
Components ==> NamedResponses
Components ==> NamedSchemas
Components ==> NamedParameters
Components ==> NamedRequestBodies --> RequestBody
Components ==> NamedHeaders
Components ==> NamedSecuritySchemes
Components ==> NamedLinks
Components ==> NamedCallbacks
Components ==> NamedPathItems
This rule is for spec correctness.
All the fixed fields declared below are objects that MUST use keys that match the regular expression: ^[a-zA-Z0-9\.\-_]+$.
- schemas
- responses
- parameters
- examples
- requestBodies
- headers
- securitySchemes
- links
- callbacks
- pathItems
| Option | Type | Description |
|---|---|---|
| severity | string | Possible values: off, warn, error. Default error (in recommended configuration). |
An example configuration:
rules:
spec-components-invalid-map-name: errorGiven this configuration:
rules:
spec-components-invalid-map-name: errorExample of incorrect operation response:
components:
examples:
invalid identifier:
description: invalid identifier
value: 21Example of correct operation response:
components:
examples:
valid_identifier:
description: valid identifier
value: 21