Queen's University at Kingston · API Governance Rules

Queen's University at Kingston API Rules

Spectral linting rules defining API design standards and conventions for Queen's University at Kingston.

6 Rules error 1 warn 4 info 1
View Rules File View on GitHub

Rule Categories

qudv

Rules

error
qudv-info-object
API info object should declare a title and version.
$.info
warn
qudv-server-defined
A server should be declared so consumers know the base URL (Borealis hosts the Queen's Dataverse).
$
warn
qudv-operation-tags
Every operation should carry at least one tag, as the Dataverse API groups operations by tag.
$.paths[*][get,post,put,delete,patch]
warn
qudv-operation-summary
Every operation should have a summary describing what it does.
$.paths[*][get,post,put,delete,patch]
warn
qudv-operation-id
Every operation should have a unique operationId for code generation.
$.paths[*][get,post,put,delete,patch]
info
qudv-api-prefix
Native API paths are served under the /api base; access endpoints under /access.
$.paths

Spectral Ruleset

Raw ↑
formats:
  - oas3
rules:
  qudv-info-object:
    description: API info object should declare a title and version.
    severity: error
    given: $.info
    then:
      - field: title
        function: truthy
      - field: version
        function: truthy

  qudv-server-defined:
    description: A server should be declared so consumers know the base URL (Borealis hosts the Queen's Dataverse).
    severity: warn
    given: $
    then:
      field: servers
      function: truthy

  qudv-operation-tags:
    description: Every operation should carry at least one tag, as the Dataverse API groups operations by tag.
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: tags
      function: truthy

  qudv-operation-summary:
    description: Every operation should have a summary describing what it does.
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: summary
      function: truthy

  qudv-operation-id:
    description: Every operation should have a unique operationId for code generation.
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: operationId
      function: truthy

  qudv-api-prefix:
    description: Native API paths are served under the /api base; access endpoints under /access.
    severity: info
    given: $.paths
    then:
      function: defined