Cardiff University · API Governance Rules

Cardiff University API Rules

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

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

Rule Categories

cardiff

Rules

warn
cardiff-info-contact-email
API info should advertise the Cardiff integration contact email.
$.info
error
cardiff-https-servers
Cardiff APIs are served over HTTPS via the api.data.cardiff.ac.uk gateway.
$.servers[*].url
warn
cardiff-oauth2-security
Operations should be protected by the OAuth2 security scheme (named "default").
$.components.securitySchemes
warn
cardiff-response-envelope
Successful JSON responses should use the standard data + meta envelope.
$.paths[*][get].responses.200.content.application/json.schema.properties
warn
cardiff-operation-summary
Every operation should have a human-readable summary.
$.paths[*][get,post,put,delete]

Spectral Ruleset

Raw ↑
extends: []
formats:
  - oas3
documentationUrl: https://data.cardiff.ac.uk/devportal/
rules:
  cardiff-info-contact-email:
    description: API info should advertise the Cardiff integration contact email.
    message: "{{description}}"
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy
  cardiff-https-servers:
    description: Cardiff APIs are served over HTTPS via the api.data.cardiff.ac.uk gateway.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: "^https://"
  cardiff-oauth2-security:
    description: Operations should be protected by the OAuth2 security scheme (named "default").
    severity: warn
    given: $.components.securitySchemes
    then:
      field: default
      function: truthy
  cardiff-response-envelope:
    description: Successful JSON responses should use the standard data + meta envelope.
    severity: warn
    given: $.paths[*][get].responses.200.content.application/json.schema.properties
    then:
      - field: data
        function: truthy
      - field: meta
        function: truthy
  cardiff-operation-summary:
    description: Every operation should have a human-readable summary.
    severity: warn
    given: $.paths[*][get,post,put,delete]
    then:
      field: summary
      function: truthy

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/cardiff-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.