Tecnológico de Monterrey · API Governance Rules

Tecnológico de Monterrey API Rules

Spectral linting rules defining API design standards and conventions for Tecnológico de Monterrey.

5 Rules error 2 warn 2 info 1
View Rules File View on GitHub

Rule Categories

tec

Rules

error
tec-info-title
API document must have a title.
$.info.title
warn
tec-servers-public-host
Server URLs should use the public datahub.tec.mx host, not internal itesm.mx deployment hosts.
$.servers[*].url
info
tec-paths-versioned
Dataverse Native API paths are versioned under /api/v1/.
$.paths[*]~
warn
tec-operation-id
Every operation should declare an operationId.
$.paths[*][get,post,put,delete,patch].operationId
error
tec-response-defined
Every operation should define at least one response.
$.paths[*][get,post,put,delete,patch].responses

Spectral Ruleset

Raw ↑
extends: [[spectral:oas, off]]
formats: [oas3]
documentationUrl: https://guides.dataverse.org/en/5.9/api/native-api.html
rules:
  tec-info-title:
    description: API document must have a title.
    given: $.info.title
    severity: error
    then:
      function: truthy
  tec-servers-public-host:
    description: Server URLs should use the public datahub.tec.mx host, not internal itesm.mx deployment hosts.
    given: $.servers[*].url
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "datahub\\.tec\\.mx"
  tec-paths-versioned:
    description: Dataverse Native API paths are versioned under /api/v1/.
    given: $.paths[*]~
    severity: info
    then:
      function: pattern
      functionOptions:
        match: "^/api/v1/"
  tec-operation-id:
    description: Every operation should declare an operationId.
    given: $.paths[*][get,post,put,delete,patch].operationId
    severity: warn
    then:
      function: truthy
  tec-response-defined:
    description: Every operation should define at least one response.
    given: $.paths[*][get,post,put,delete,patch].responses
    severity: error
    then:
      function: truthy