Eindhoven University of Technology · API Governance Rules

Eindhoven University of Technology API Rules

Spectral linting rules defining API design standards and conventions for Eindhoven University of Technology.

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

Rule Categories

tue

Rules

error
tue-pure-info-title
API must declare a title (observed "Pure API").
$.info
error
tue-pure-info-version
API must declare a version (observed Pure 5.x release tag).
$.info
warn
tue-pure-server-ws-api
Servers should be rooted at the Pure /ws/api base path.
$.servers[*].url
warn
tue-pure-collection-plural
Top-level research-content collections are lower-case plural nouns (persons, research-outputs, organizations, projects, data-sets).
$.paths[*]~
info
tue-pure-uuid-path-param
Single-resource lookups should be keyed by a uuid/id path parameter.
$.paths[?(@property.match(/\\{.*\\}$/))]~
warn
tue-pure-operation-tags
Every operation should be tagged for grouping in the Pure portal.
$.paths[*][get,post,put,delete]

Spectral Ruleset

Raw ↑
extends: []
formats:
  - oas3
documentationUrl: https://github.com/api-evangelist/eindhoven-university-of-technology
rules:
  tue-pure-info-title:
    description: API must declare a title (observed "Pure API").
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  tue-pure-info-version:
    description: API must declare a version (observed Pure 5.x release tag).
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  tue-pure-server-ws-api:
    description: Servers should be rooted at the Pure /ws/api base path.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: "/ws/api"
  tue-pure-collection-plural:
    description: Top-level research-content collections are lower-case plural nouns (persons, research-outputs, organizations, projects, data-sets).
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: "^/[a-z][a-z0-9-]*"
  tue-pure-uuid-path-param:
    description: Single-resource lookups should be keyed by a uuid/id path parameter.
    severity: info
    given: $.paths[?(@property.match(/\\{.*\\}$/))]~
    then:
      function: pattern
      functionOptions:
        match: "\\{(id|uuid|pureId)\\}$"
  tue-pure-operation-tags:
    description: Every operation should be tagged for grouping in the Pure portal.
    severity: warn
    given: $.paths[*][get,post,put,delete]
    then:
      field: tags
      function: truthy