Thermo Fisher Scientific · API Governance Rules

Thermo Fisher Scientific API Rules

Spectral linting rules defining API design standards and conventions for Thermo Fisher Scientific.

9 Rules error 2 warn 6 info 1
View Rules File View on GitHub

Rule Categories

thermo

Rules

warn
thermo-fisher-operation-summary-title-case
All operation summaries must use Title Case.
$.paths[*][*].summary
warn
thermo-fisher-operation-ids-camel-case
All operationIds must use camelCase.
$.paths[*][*].operationId
error
thermo-fisher-tags-required
All operations must have at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
thermo-fisher-description-required
All operations must have a description.
$.paths[*][get,post,put,patch,delete]
warn
thermo-fisher-auth-defined
Non-public operations must declare authentication.
$.paths[*][get,post,put,patch,delete]
error
thermo-fisher-200-response-defined
All GET operations must define a 200 response.
$.paths[*][get].responses
warn
thermo-fisher-401-response-defined
All authenticated operations must define a 401 response.
$.paths[*][get,post,put,patch,delete].responses
info
thermo-fisher-path-kebab-case
All path segments must use kebab-case or camelCase (matching LIMS patterns).
$.paths[*]~
warn
thermo-fisher-request-body-post
POST operations should define a request body.
$.paths[*][post]

Spectral Ruleset

Raw ↑
rules:
  thermo-fisher-operation-summary-title-case:
    description: All operation summaries must use Title Case.
    message: "Operation summary '{{value}}' must use Title Case."
    severity: warn
    given: "$.paths[*][*].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9 ]*$"

  thermo-fisher-operation-ids-camel-case:
    description: All operationIds must use camelCase.
    message: "OperationId '{{value}}' must be camelCase."
    severity: warn
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  thermo-fisher-tags-required:
    description: All operations must have at least one tag.
    message: "Operation at '{{path}}' must have at least one tag."
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  thermo-fisher-description-required:
    description: All operations must have a description.
    message: "Operation at '{{path}}' is missing a description."
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: description
      function: truthy

  thermo-fisher-auth-defined:
    description: Non-public operations must declare authentication.
    message: "Operation at '{{path}}' should declare security scheme."
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

  thermo-fisher-200-response-defined:
    description: All GET operations must define a 200 response.
    message: "GET operation at '{{path}}' must define a 200 response."
    severity: error
    given: "$.paths[*][get].responses"
    then:
      field: "200"
      function: defined

  thermo-fisher-401-response-defined:
    description: All authenticated operations must define a 401 response.
    message: "Authenticated operation at '{{path}}' should define a 401 response."
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].responses"
    then:
      field: "401"
      function: defined

  thermo-fisher-path-kebab-case:
    description: All path segments must use kebab-case or camelCase (matching LIMS patterns).
    message: "Path '{{path}}' segments should use lowercase."
    severity: info
    given: "$.paths[*]~"
    then:
      function: pattern
      functionOptions:
        match: "^(/[a-zA-Z0-9{}_-]*)*$"

  thermo-fisher-request-body-post:
    description: POST operations should define a request body.
    message: "POST operation at '{{path}}' should define a request body."
    severity: warn
    given: "$.paths[*][post]"
    then:
      field: requestBody
      function: defined