University of Geneva · API Governance Rules

University of Geneva API Rules

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

7 Rules warn 4 info 3
View Rules File View on GitHub

Rule Categories

unige

Rules

warn
unige-info-contact-email
Yareta API info block must carry the [email protected] contact email.
$.info.contact
warn
unige-servers-are-yareta-hosts
Servers should be the official Yareta DLCM backend hosts on unige.ch.
$.servers[*].url
info
unige-resid-uuid-identifier
Resources expose a 'resId' identifier (UUID by default, max length 50).
$.components.schemas[?(@.properties && @.properties.resId)].properties.resId
info
unige-change-info-readonly
ChangeInfo audit fields (who/when/fullName) are read-only.
$.components.schemas.ChangeInfo.properties[*]
warn
unige-orcid-pattern-present
Person ORCID values must declare the ORCID format pattern.
$.components.schemas.Person.properties.orcid
warn
unige-operation-tagged
Every operation should be tagged (Access, Ingest, or OAI-PMH).
$.paths[*][get,post,put,delete,patch]
info
unige-oais-package-descriptions
OAIS package schemas (AIP/DIP) should be documented with a description.
$.components.schemas.ArchivalInfoPackage$.components.schemas.DisseminationInfoPackage

Spectral Ruleset

Raw ↑
# Spectral ruleset for the University of Geneva (UNIGE) Yareta Research Data API.
# Encodes patterns observed in the live DLCM/Yareta OpenAPI 3.1 definitions
# (Yareta API v3.1.7) served from access.yareta.unige.ch and ingest.yareta.unige.ch.
formats:
  - oas3
rules:
  unige-info-contact-email:
    description: Yareta API info block must carry the [email protected] contact email.
    severity: warn
    given: $.info.contact
    then:
      field: email
      function: truthy

  unige-servers-are-yareta-hosts:
    description: Servers should be the official Yareta DLCM backend hosts on unige.ch.
    severity: warn
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: "^https://(access|ingest|yareta)\\.unige\\.ch"

  unige-resid-uuid-identifier:
    description: Resources expose a 'resId' identifier (UUID by default, max length 50).
    severity: info
    given: $.components.schemas[?(@.properties && @.properties.resId)].properties.resId
    then:
      field: maxLength
      function: truthy

  unige-change-info-readonly:
    description: ChangeInfo audit fields (who/when/fullName) are read-only.
    severity: info
    given: $.components.schemas.ChangeInfo.properties[*]
    then:
      field: readOnly
      function: truthy

  unige-orcid-pattern-present:
    description: Person ORCID values must declare the ORCID format pattern.
    severity: warn
    given: $.components.schemas.Person.properties.orcid
    then:
      field: pattern
      function: truthy

  unige-operation-tagged:
    description: Every operation should be tagged (Access, Ingest, or OAI-PMH).
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: tags
      function: truthy

  unige-oais-package-descriptions:
    description: OAIS package schemas (AIP/DIP) should be documented with a description.
    severity: info
    given:
      - $.components.schemas.ArchivalInfoPackage
      - $.components.schemas.DisseminationInfoPackage
    then:
      field: description
      function: truthy