University of Adelaide · API Governance Rules

University of Adelaide API Rules

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

6 Rules error 2 warn 3 info 1
View Rules File View on GitHub

Rule Categories

uoa

Rules

warn
uoa-info-contact
API info should declare a contact (Figshare Support).
$.info
error
uoa-servers-defined
A server URL must be defined (api.figshare.com/v2).
$
warn
uoa-article-has-doi
Article objects should expose a DOI property.
$.components.schemas.Article.properties
error
uoa-article-has-id
Article objects must expose an integer id.
$.components.schemas.Article.properties.id
info
uoa-resource-urls-are-uri
URL-bearing fields should use url/uri formatting where present.
$.components.schemas.Article.properties.url
warn
uoa-operations-have-tags
Every operation should be tagged for discoverability.
$.paths[*][get,post,put,delete,patch]

Spectral Ruleset

Raw ↑
---
# Spectral ruleset for the University of Adelaide Figshare research data API.
# Encodes patterns observed in the real Figshare OpenAPI 3.0.3 description.
formats:
  - oas3
rules:
  uoa-info-contact:
    description: API info should declare a contact (Figshare Support).
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  uoa-servers-defined:
    description: A server URL must be defined (api.figshare.com/v2).
    severity: error
    given: $
    then:
      field: servers
      function: truthy
  uoa-article-has-doi:
    description: Article objects should expose a DOI property.
    severity: warn
    given: $.components.schemas.Article.properties
    then:
      field: doi
      function: truthy
  uoa-article-has-id:
    description: Article objects must expose an integer id.
    severity: error
    given: $.components.schemas.Article.properties.id
    then:
      field: type
      function: pattern
      functionOptions:
        match: "integer"
  uoa-resource-urls-are-uri:
    description: URL-bearing fields should use url/uri formatting where present.
    severity: info
    given: $.components.schemas.Article.properties.url
    then:
      field: format
      function: truthy
  uoa-operations-have-tags:
    description: Every operation should be tagged for discoverability.
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: tags
      function: truthy