valid-component-name
Overview
This rule belongs to the openapi-v3-syntax-validation ruleset and states that:
Component name must contain only alphanumeric, dash (-), underscore (_) and period (.) characters. Spaces are not allowed.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Error |
| Message | Component name is invalid. |
| Code | OPENAPI3SYNTAX_V020 |
| Type | Validation |
| Rule System | Syntax |
| Broad Category | Components |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | openapi3 openapi syntax validation name components |
Suggested Fixes
- Ensure that the component name follows the regex pattern ^[a-zA-Z0-9.-_]+$
- Remove any invalid characters from the component name.
- Remove any spaces from the name.
For More Information
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#components-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#components-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/