Skip to main content

component-name-unique

Requires component names to be unique within each supported component type.

AttributeValue
CategoryMetadata
MaturityBronze
OpenAPISwagger 2.0; OpenAPI 3.0, 3.1, 3.2
Starter–RecommendedOff
StrictWarning
CompleteError

Intent

Colliding reusable names make references and generated types ambiguous, especially when contracts span files.

Flags

Every definition in a duplicate group for schemas, parameters, responses, or request bodies. Names are normalized by removing the final file extension and comparing lowercase text within the same component type. Local components and referenced external definitions participate.

Does not flag

Unique normalized names or equal names in different component types. Any of the four types can be disabled independently.

See it fail

components:
schemas:
Customer:
type: object
customer:
type: object

Both normalize to customer within schemas.

Fix it

Give each reusable schema a distinct name and update its references:

components:
schemas:
Customer:
type: object
CustomerSummary:
type: object

Configure

profiles:
default:
rules:
extends: [strict]
override:
component-name-unique:
severity: error
schemas: on
parameters: off
responses: on
requestBodies: on

Nearby: spec-components-invalid-map-name, schema-definition-camel-case.