Technical University of Munich · API Governance Rules

Technical University of Munich API Rules

Spectral linting rules defining API design standards and conventions for Technical University of Munich.

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

Rule Categories

tum

Rules

warn
tum-info-contact
API info object should declare a contact (TUM-Dev specs provide one).
$.info
warn
tum-info-license
API should declare a license (TUM-Dev projects are open source / GPL).
$.info
warn
tum-operation-tags
Every operation should carry at least one tag for grouping.
$.paths[*][get,post,put,delete,patch]
error
tum-server-https
Servers must use HTTPS, as all TUM-Dev public endpoints do.
$.servers[*].url
warn
tum-schemas-typed
Component schemas should declare a type.
$.components.schemas[*]

Spectral Ruleset

Raw ↑
extends: []
formats:
  - oas3
documentationUrl: https://github.com/api-evangelist/tum
description: >-
  Spectral ruleset encoding patterns observed across the TUM-Dev public APIs
  (NavigaTUM and eat-api). Derived from the real OpenAPI specifications.
rules:
  tum-info-contact:
    description: API info object should declare a contact (TUM-Dev specs provide one).
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  tum-info-license:
    description: API should declare a license (TUM-Dev projects are open source / GPL).
    severity: warn
    given: $.info
    then:
      field: license
      function: truthy
  tum-operation-tags:
    description: Every operation should carry at least one tag for grouping.
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: tags
      function: truthy
  tum-server-https:
    description: Servers must use HTTPS, as all TUM-Dev public endpoints do.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: "^https://"
  tum-schemas-typed:
    description: Component schemas should declare a type.
    severity: warn
    given: $.components.schemas[*]
    then:
      field: type
      function: truthy