Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 13, 2022 12:36 am GMT

Spectral: Rules for checking if an operationId is a camelCase

This rule checks if operationId is camelCase in spectral.

extends: spectral:oasaliases:  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:

Image description


Original Link: https://dev.to/suin/spectral-rules-for-checking-if-an-operationid-is-a-camelcase-3hmd

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To