University of Hong Kong · API Governance Rules

University of Hong Kong API Rules

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

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

Rule Categories

hku

Rules

error
hku-info-title
The document must carry a title.
$.info
warn
hku-info-description-length
The description must explain what the surface is and who operates it.
$.info
error
hku-operator-declared
Every HKU document must declare x-operator, because attribution is the whole point of the university profile.
$
error
hku-provenance-block
Every derived document must carry x-provenance with a method.
$.x-provenance
error
hku-servers-institution-host
Servers must be on an hku.hk host; anything else belongs in a tenant record, not here.
$.servers[*].url
error
hku-operation-id
Every operation needs an operationId.
$.paths[*][get,post,put,patch,delete]
warn
hku-operation-probe
Every operation must record the status code actually observed when probed.
$.paths[*][get,post,put,patch,delete]
warn
hku-probe-status
A probe record must carry a numeric status.
$.paths[*][*].x-probe
warn
hku-operation-tags
Every operation must be tagged so the document can be split cleanly.
$.paths[*][get,post,put,patch,delete]
warn
hku-security-schemes-defined
Security schemes must be declared.
$.components
error
hku-no-vendor-servers
A vendor host must never appear as a server on an institution document.
$.servers[*].url

Spectral Ruleset

Raw ↑
# Spectral ruleset for the HKU identity surface.
# generated: 2026-08-19
# method: generated
# source: openapi/hku-identity-openapi.yml
# x-operator: institution (the surface); the ruleset itself is API Evangelist's, not HKU's.
# Built-in Spectral functions only — no custom JS.
extends: []
documentationUrl: https://apievangelist.com/
rules:
  hku-info-title:
    description: The document must carry a title.
    given: $.info
    severity: error
    then:
      field: title
      function: truthy
  hku-info-description-length:
    description: The description must explain what the surface is and who operates it.
    given: $.info
    severity: warn
    then:
      field: description
      function: length
      functionOptions:
        min: 200
  hku-operator-declared:
    description: Every HKU document must declare x-operator, because attribution is the whole point of the university profile.
    given: $
    severity: error
    then:
      field: x-operator
      function: pattern
      functionOptions:
        match: '^(institution|tenant|vendor|placeholder)$'
  hku-provenance-block:
    description: Every derived document must carry x-provenance with a method.
    given: $.x-provenance
    severity: error
    then:
      field: method
      function: pattern
      functionOptions:
        match: '^(searched|generated|derived|probed|none)$'
  hku-servers-institution-host:
    description: Servers must be on an hku.hk host; anything else belongs in a tenant record, not here.
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: '^https://[a-z0-9.-]*hku\.hk'
  hku-operation-id:
    description: Every operation needs an operationId.
    given: $.paths[*][get,post,put,patch,delete]
    severity: error
    then:
      field: operationId
      function: truthy
  hku-operation-probe:
    description: Every operation must record the status code actually observed when probed.
    given: $.paths[*][get,post,put,patch,delete]
    severity: warn
    then:
      field: x-probe
      function: truthy
  hku-probe-status:
    description: A probe record must carry a numeric status.
    given: $.paths[*][*].x-probe
    severity: warn
    then:
      field: status
      function: truthy
  hku-operation-tags:
    description: Every operation must be tagged so the document can be split cleanly.
    given: $.paths[*][get,post,put,patch,delete]
    severity: warn
    then:
      field: tags
      function: truthy
  hku-security-schemes-defined:
    description: Security schemes must be declared.
    given: $.components
    severity: warn
    then:
      field: securitySchemes
      function: truthy
  hku-no-vendor-servers:
    description: A vendor host must never appear as a server on an institution document.
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        notMatch: '(figshare|elsevierpure|exlibrisgroup|symplectic|dataverse|instructure)\.com'

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/hku-identity-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.