University of Newcastle Australia · API Governance Rules

University of Newcastle Australia API Rules

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

6 Rules warn 4 info 2
View Rules File View on GitHub

Rule Categories

uon

Rules

warn
uon-info-contact
API info object should declare a contact.
$.info
warn
uon-server-figshare-v2
Server URL should be the public Figshare v2 API base.
$.servers[*].url
warn
uon-article-has-doi
The Article schema should expose a doi property (research outputs are DOI-minted).
$.components.schemas.Article.properties
warn
uon-article-has-public-url
The Article schema should expose a public HTML url for citation/linking.
$.components.schemas.Article.properties
info
uon-author-orcid
The Author schema should carry an orcid_id for researcher identity.
$.components.schemas.Author.properties
info
uon-url-format
Properties named like URLs should declare format url/uri.
$.components.schemas..properties[?(@property.match(/url/i))]

Spectral Ruleset

Raw ↑
---
# Spectral ruleset encoding patterns observed in the Figshare REST API v2
# as consumed by Open Research Newcastle (University of Newcastle Australia).
formats: [oas3]
rules:
  uon-info-contact:
    description: API info object should declare a contact.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy

  uon-server-figshare-v2:
    description: Server URL should be the public Figshare v2 API base.
    given: $.servers[*].url
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^https://api\\.figshare\\.com/v2"

  uon-article-has-doi:
    description: The Article schema should expose a doi property (research outputs are DOI-minted).
    given: $.components.schemas.Article.properties
    severity: warn
    then:
      field: doi
      function: truthy

  uon-article-has-public-url:
    description: The Article schema should expose a public HTML url for citation/linking.
    given: $.components.schemas.Article.properties
    severity: warn
    then:
      field: url_public_html
      function: truthy

  uon-author-orcid:
    description: The Author schema should carry an orcid_id for researcher identity.
    given: $.components.schemas.Author.properties
    severity: info
    then:
      field: orcid_id
      function: truthy

  uon-url-format:
    description: Properties named like URLs should declare format url/uri.
    given: $.components.schemas..properties[?(@property.match(/url/i))]
    severity: info
    then:
      field: format
      function: truthy