Indian Institute of Technology Kanpur · API Governance Rules

Indian Institute of Technology Kanpur API Rules

Spectral linting rules defining API design standards and conventions for Indian Institute of Technology Kanpur.

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

Rule Categories

iitk

Rules

error
iitk-operation-operationId
Operations must define an operationId.
$.paths[*][get,post,put,delete,patch]
warn
iitk-operation-tags
Operations should be grouped under at least one tag.
$.paths[*][get,post,put,delete,patch]
warn
iitk-path-snake-case
Path segments should be lower snake_case (Koha convention).
$.paths[*]~
info
iitk-public-prefix-known
Document that user-facing discovery endpoints are namespaced under /public.
$.paths[*]~
info
iitk-pagination-params
List operations should expose _page / _per_page pagination parameters.
$.paths[*].get.parameters[?(@.in=='query')].name
warn
iitk-error-response-documented
Non-2xx responses should be documented with a description.
$.paths[*][*].responses[?(@property >= '400')]

Spectral Ruleset

Raw ↑
# method: derived
# generated: '2026-09-01'
# source: openapi/_original/iit-kanpur-library-rest.yaml
# Authored by API Evangelist from the Koha contract; not published by IIT Kanpur.
# Spectral ruleset for the PKK Library (IIT Kanpur) Koha REST API.
# Encodes patterns observed in the live OpenAPI description served at
# https://libserv.iitk.ac.in/api/v1/ (Koha 23.11 REST API).
formats:
  - oas3
extends:
  - spectral:oas
rules:
  # Every operation should declare an operationId (the Koha spec does).
  iitk-operation-operationId:
    description: Operations must define an operationId.
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: operationId
      function: truthy

  # Operations should be tagged by resource (acquisitions, biblios, items, libraries, patrons...).
  iitk-operation-tags:
    description: Operations should be grouped under at least one tag.
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: tags
      function: truthy

  # Collection paths use lower_snake_case plural nouns (e.g. /biblios, /acquisitions/orders).
  iitk-path-snake-case:
    description: Path segments should be lower snake_case (Koha convention).
    severity: warn
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: "^(/[a-z0-9_.-]+(\\{[a-zA-Z0-9_]+\\})?)+$|^/$"

  # Public discovery endpoints live under the /public path prefix.
  iitk-public-prefix-known:
    description: Document that user-facing discovery endpoints are namespaced under /public.
    severity: info
    given: $.paths[*]~
    then:
      function: defined

  # Pagination query params follow the underscore-prefixed Koha convention (_page, _per_page).
  iitk-pagination-params:
    description: List operations should expose _page / _per_page pagination parameters.
    severity: info
    given: $.paths[*].get.parameters[?(@.in=='query')].name
    then:
      function: defined

  # Errors should follow the documented { error, error_code } shape.
  iitk-error-response-documented:
    description: Non-2xx responses should be documented with a description.
    severity: warn
    given: $.paths[*][*].responses[?(@property >= '400')]
    then:
      field: description
      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/iit-kanpur-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.