This rule checks if operationId
is camelCase in spectral.
extends: spectral:oas
aliases:
PathItem:
- $.paths[*]
OperationObject:
- "#PathItem[get,put,post,delete,options,head,patch,trace]"
rules:
operation-id-camel-case:
description: Operation IDs must be camelCase since some generators (e.g. RTK Query) don't support kebab-cases.
message: "Operation ID \"{{value}}\" must be camelCase since some generators (e.g. RTK Query) don't support kebab-cases."
given: "#OperationObject"
severity: error
then:
field: operationId
function: casing
functionOptions:
type: camel
Example of detecting errors:
Top comments (0)