University of Göttingen · API Governance Rules

University of Göttingen API Rules

Spectral linting rules defining API design standards and conventions for University of Göttingen.

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

Rule Categories

grodata

Rules

warn
grodata-info-description
API info object must have a description.
$.info
error
grodata-server-present
A server URL must be declared (GRO.data Dataverse base URL).
$
warn
grodata-operation-tags
Every operation should carry at least one tag (Dataverse groups operations by tag).
$.paths[*][get,post,put,delete,patch]
hint
grodata-json-responses
Dataverse REST responses are JSON envelopes with a top-level status field.
$.paths[*][get,post,put,delete].responses[*].content
warn
grodata-no-trailing-slash
Paths should not end with a trailing slash.
$.paths

Spectral Ruleset

Raw ↑
rules:
  grodata-info-description:
    description: API info object must have a description.
    given: $.info
    severity: warn
    then:
      field: description
      function: truthiness
  grodata-server-present:
    description: A server URL must be declared (GRO.data Dataverse base URL).
    given: $
    severity: error
    then:
      field: servers
      function: truthiness
  grodata-operation-tags:
    description: Every operation should carry at least one tag (Dataverse groups operations by tag).
    given: $.paths[*][get,post,put,delete,patch]
    severity: warn
    then:
      field: tags
      function: truthiness
  grodata-json-responses:
    description: Dataverse REST responses are JSON envelopes with a top-level status field.
    given: $.paths[*][get,post,put,delete].responses[*].content
    severity: hint
    then:
      function: truthiness
  grodata-no-trailing-slash:
    description: Paths should not end with a trailing slash.
    given: $.paths
    severity: warn
    then:
      field: '@key'
      function: pattern
      functionOptions:
        notMatch: '.+/$'
extends: []
formats:
  - oas3