UCSC Genomic Data · API Governance Rules

UCSC Genomic Data API Rules

Spectral linting rules defining API design standards and conventions for UCSC Genomic Data.

6 Rules error 1 warn 5
View Rules File View on GitHub

Rule Categories

ucsc

Rules

error
ucsc-has-operation-id
All operations must have an operationId.
$.paths[*][get,post,put,patch,delete]
warn
ucsc-operation-id-camel-case
Operation IDs must use camelCase.
$.paths[*][get,post,put,patch,delete].operationId
warn
ucsc-has-description
All operations must have a description.
$.paths[*][get,post,put,patch,delete]
warn
ucsc-has-tags
All operations must have at least one tag.
$.paths[*][get,post,put,patch,delete]
warn
ucsc-summary-title-case
Operation summaries must use Title Case.
$.paths[*][get,post,put,patch,delete].summary
warn
ucsc-get-has-response-schema
GET operations should define a response schema for 200.
$.paths[*].get.responses.200

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  ucsc-has-operation-id:
    description: All operations must have an operationId.
    message: Operation is missing operationId.
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  ucsc-operation-id-camel-case:
    description: Operation IDs must use camelCase.
    message: "Operation ID '{{value}}' must use camelCase."
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  ucsc-has-description:
    description: All operations must have a description.
    message: Operation is missing a description.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: description
      function: truthy

  ucsc-has-tags:
    description: All operations must have at least one tag.
    message: Operation is missing tags.
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  ucsc-summary-title-case:
    description: Operation summaries must use Title Case.
    message: "Summary '{{value}}' should use Title Case."
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9 ]+$"

  ucsc-get-has-response-schema:
    description: GET operations should define a response schema for 200.
    message: GET 200 response at '{{path}}' should define a content schema.
    severity: warn
    given: "$.paths[*].get.responses.200"
    then:
      field: content
      function: truthy