University of Sheffield · API Governance Rules

University of Sheffield API Rules

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

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

Rule Categories

uos

Rules

error
uos-info-title
API must declare a title.
$.info
warn
uos-info-description
API should provide a description.
$.info
warn
uos-server-figshare
Server URL should target the figshare v2 API base used by ORDA.
$.servers[*]
warn
uos-operation-tags
Every operation should be tagged so research-data endpoints stay grouped.
$.paths[*][get,post,put,delete]
warn
uos-article-id-integer
Article identifiers are integers across the figshare API.
$.components.schemas.Article.properties.id
warn
uos-doi-present
Research output objects should expose a DOI for citation.
$.components.schemas.Article.properties

Spectral Ruleset

Raw ↑
---
# Spectral ruleset encoding patterns observed in the figshare API
# powering the University of Sheffield ORDA research data repository.
formats:
  - oas3
rules:
  uos-info-title:
    description: API must declare a title.
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  uos-info-description:
    description: API should provide a description.
    severity: warn
    given: $.info
    then:
      field: description
      function: truthy
  uos-server-figshare:
    description: Server URL should target the figshare v2 API base used by ORDA.
    severity: warn
    given: $.servers[*]
    then:
      field: url
      function: pattern
      functionOptions:
        match: "^https://api\\.figshare\\.com/v2"
  uos-operation-tags:
    description: Every operation should be tagged so research-data endpoints stay grouped.
    severity: warn
    given: $.paths[*][get,post,put,delete]
    then:
      field: tags
      function: truthy
  uos-article-id-integer:
    description: Article identifiers are integers across the figshare API.
    severity: warn
    given: $.components.schemas.Article.properties.id
    then:
      field: type
      function: pattern
      functionOptions:
        match: "^integer$"
  uos-doi-present:
    description: Research output objects should expose a DOI for citation.
    severity: warn
    given: $.components.schemas.Article.properties
    then:
      field: doi
      function: truthy