Spectral: operationId가 camelCase인지 확인하는 규칙

2813 단어 spectralopenapi
이 규칙은 operationIdspectral의 camelCase인지 확인합니다.


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


오류 감지의 예:

좋은 웹페이지 즐겨찾기