Kyoto University · API Governance Rules

Kyoto University API Rules

Spectral linting rules defining API design standards and conventions for Kyoto University.

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

Rule Categories

kyoto

Rules

warn
kyoto-info-contact
API info must declare a contact (KURENAI repository administration).
$.info
error
kyoto-server-is-kurenai
Servers must point at the KURENAI repository host.
$.servers[*].url
warn
kyoto-operation-ids
Every operation should carry an operationId.
$.paths[*][get,post,put,delete,patch]
info
kyoto-hal-links
HAL response schemas should expose a _links object.
$.components.schemas[?(@property == 'Community' || @property == 'RestRoot')].properties
warn
kyoto-oai-verb-enum
The OAI-PMH endpoint must enumerate the standard verbs.
$.paths['/server/oai/request'].get.parameters[?(@.name == 'verb')].schema

Spectral Ruleset

Raw ↑
extends: [[spectral:oas, off]]
formats:
  - oas3
documentationUrl: https://repository.kulib.kyoto-u.ac.jp/
rules:
  kyoto-info-contact:
    description: API info must declare a contact (KURENAI repository administration).
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy
  kyoto-server-is-kurenai:
    description: Servers must point at the KURENAI repository host.
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "^https://repository\\.kulib\\.kyoto-u\\.ac\\.jp"
  kyoto-operation-ids:
    description: Every operation should carry an operationId.
    given: $.paths[*][get,post,put,delete,patch]
    severity: warn
    then:
      field: operationId
      function: truthy
  kyoto-hal-links:
    description: HAL response schemas should expose a _links object.
    given: $.components.schemas[?(@property == 'Community' || @property == 'RestRoot')].properties
    severity: info
    then:
      field: _links
      function: truthy
  kyoto-oai-verb-enum:
    description: The OAI-PMH endpoint must enumerate the standard verbs.
    given: $.paths['/server/oai/request'].get.parameters[?(@.name == 'verb')].schema
    severity: warn
    then:
      field: enum
      function: truthy