University of Auckland · API Governance Rules

University of Auckland API Rules

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

15 Rules error 6 warn 9
View Rules File View on GitHub

Rule Categories

uoa

Rules

error
uoa-info-title-present
Every University of Auckland API must declare info.title.
$.info
error
uoa-info-version-present
Every University of Auckland API must declare info.version.
$.info
warn
uoa-info-contact-present
Both published University documents name a contact (Student Recruitment). Keep it — it is the only support channel a caller has before registering in the portal.
$.info
warn
uoa-info-contact-email-institutional
info.contact.email should be an auckland.ac.nz address.
$.info.contact
error
uoa-server-scheme
servers[].url must begin with https:// — the published Course Catalog Api V3 document says "httpss://apis.auckland.ac.nz/courses/v3", which no client can resolve.
$.servers[*].url
error
uoa-server-institution-host
servers[].url must be under an auckland.ac.nz host. A server on a vendor host means the contract is the vendor's, not the University's.
$.servers[*].url
error
uoa-operation-id-present
Every operation must carry an operationId.
$.paths[*][get,put,post,delete,patch]
warn
uoa-operation-id-camel-case
operationIds are camelCase across both documents (classesGet, coursesGetBySubject).
$.paths[*][get,put,post,delete,patch].operationId
warn
uoa-operation-description-present
Every operation carries a description in both published documents. Keep it.
$.paths[*][get,put,post,delete,patch]
warn
uoa-operation-summary-present
Only 1 of 13 published operations carries a summary. A summary is what a catalogue, an SDK generator and an agent read first.
$.paths[*][get,put,post,delete,patch]
warn
uoa-response-media-type-json
Both documents declare "*/*" as the response media type. Declare application/json — the gateway returns JSON and "*/*" tells a generated client nothing.
$.paths[*][get,put,post,delete,patch].responses[*].content
warn
uoa-security-scheme-declared
The gateway returns 401 on every route, so a security requirement belongs in the contract. Neither document declares a root-level `security`.
$
error
uoa-api-key-scheme-complete
An apiKey security scheme must state `name` and `in`. Both published documents declare components.securitySchemes.apikey with neither.
$.components.securitySchemes[?(@.type=='apiKey')]
warn
uoa-error-response-not-success-schema
A 4xx/5xx response must not reuse the success schema. Classes Api V2 returns ClassesList for 200, 400 and 500 alike, so a client cannot tell them apart.
$.paths[*][get,put,post,delete,patch].responses[?(@property.match(/^[45]/))].content[*]
warn
uoa-tag-declared-at-root
Tags used by operations must be declared in the root tags[]. Classes Api V2 tags its only operation "classes" while root tags[] declares only "api".
$.tags[*]

Spectral Ruleset

Raw ↑
---
# authorship: API Evangelist tooling, hand-authored for this repo on 2026-08-30.
# generated: '2026-08-30'
# method: derived
# source:
#   - openapi/_original/university-of-auckland-classes-v2-openapi.json
#   - openapi/_original/university-of-auckland-course-catalog-v3-openapi.json
# x-operator: institution
#
# Plain Spectral (built-in functions only). Rules are MEASURED from the two OpenAPI documents
# the University of Auckland publishes in its own developer portal, not imported from a vendor:
#   - openapi 3.1.0 @ 2/2 documents
#   - info.contact present @ 2/2 (Student Recruitment, student-recruitment@list.auckland.ac.nz)
#   - operationId camelCase @ 13/13 operations (classesGet, coursesGetBySubject, termsTermCodeGet)
#   - servers[] present @ 2/2 — but 1/2 is malformed ("httpss://"), which uoa-server-scheme catches
#   - response media type "*/*" @ 2/2 — flagged, not blessed
#   - summary present @ 1/13 operations; description present @ 13/13
formats:
  - oas3
extends: []
rules:
  uoa-info-title-present:
    description: Every University of Auckland API must declare info.title.
    severity: error
    given: $.info
    then:
      field: title
      function: truthy

  uoa-info-version-present:
    description: Every University of Auckland API must declare info.version.
    severity: error
    given: $.info
    then:
      field: version
      function: truthy

  uoa-info-contact-present:
    description: >-
      Both published University documents name a contact (Student Recruitment). Keep it —
      it is the only support channel a caller has before registering in the portal.
    severity: warn
    given: $.info
    then:
      field: contact
      function: truthy

  uoa-info-contact-email-institutional:
    description: info.contact.email should be an auckland.ac.nz address.
    severity: warn
    given: $.info.contact
    then:
      field: email
      function: pattern
      functionOptions:
        match: "@([a-z0-9-]+\\.)*auckland\\.ac\\.nz$"

  uoa-server-scheme:
    description: >-
      servers[].url must begin with https:// — the published Course Catalog Api V3 document
      says "httpss://apis.auckland.ac.nz/courses/v3", which no client can resolve.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: "^https://"

  uoa-server-institution-host:
    description: >-
      servers[].url must be under an auckland.ac.nz host. A server on a vendor host means the
      contract is the vendor's, not the University's.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: "^https?s?://[a-z0-9.-]*auckland\\.ac\\.nz(/|$)"

  uoa-operation-id-present:
    description: Every operation must carry an operationId.
    severity: error
    given: $.paths[*][get,put,post,delete,patch]
    then:
      field: operationId
      function: truthy

  uoa-operation-id-camel-case:
    description: operationIds are camelCase across both documents (classesGet, coursesGetBySubject).
    severity: warn
    given: $.paths[*][get,put,post,delete,patch].operationId
    then:
      function: casing
      functionOptions:
        type: camel

  uoa-operation-description-present:
    description: Every operation carries a description in both published documents. Keep it.
    severity: warn
    given: $.paths[*][get,put,post,delete,patch]
    then:
      field: description
      function: truthy

  uoa-operation-summary-present:
    description: >-
      Only 1 of 13 published operations carries a summary. A summary is what a catalogue,
      an SDK generator and an agent read first.
    severity: warn
    given: $.paths[*][get,put,post,delete,patch]
    then:
      field: summary
      function: truthy

  uoa-response-media-type-json:
    description: >-
      Both documents declare "*/*" as the response media type. Declare application/json —
      the gateway returns JSON and "*/*" tells a generated client nothing.
    severity: warn
    given: $.paths[*][get,put,post,delete,patch].responses[*].content
    then:
      field: application/json
      function: truthy

  uoa-security-scheme-declared:
    description: >-
      The gateway returns 401 on every route, so a security requirement belongs in the
      contract. Neither document declares a root-level `security`.
    severity: warn
    given: $
    then:
      field: security
      function: truthy

  uoa-api-key-scheme-complete:
    description: >-
      An apiKey security scheme must state `name` and `in`. Both published documents declare
      components.securitySchemes.apikey with neither.
    severity: error
    given: $.components.securitySchemes[?(@.type=='apiKey')]
    then:
      - field: name
        function: truthy
      - field: in
        function: truthy

  uoa-error-response-not-success-schema:
    description: >-
      A 4xx/5xx response must not reuse the success schema. Classes Api V2 returns
      ClassesList for 200, 400 and 500 alike, so a client cannot tell them apart.
    severity: warn
    given: $.paths[*][get,put,post,delete,patch].responses[?(@property.match(/^[45]/))].content[*]
    then:
      field: schema
      function: truthy

  uoa-tag-declared-at-root:
    description: >-
      Tags used by operations must be declared in the root tags[]. Classes Api V2 tags its
      only operation "classes" while root tags[] declares only "api".
    severity: warn
    given: $.tags[*]
    then:
      field: name
      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/university-of-auckland-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.