Fastly · API Governance Rules

Fastly API Rules

Spectral linting rules defining API design standards and conventions for Fastly.

7 Rules error 4 warn 2 info 1
View Rules File View on GitHub

Rule Categories

fastly

Rules

error
fastly-operation-tag-required
Every operation must have at least one tag matching a Fastly API surface.
$.paths[*][get,put,post,delete,patch,head,options]
warn
fastly-operation-summary-title-case
Operation summaries must use Title Case.
$.paths[*][get,put,post,delete,patch,head,options].summary
warn
fastly-operationid-camel-case
operationId must be lowerCamelCase.
$.paths[*][get,put,post,delete,patch,head,options].operationId
info
fastly-fastly-key-security
Operations should be secured via the Fastly-Key API key header.
$
error
fastly-no-numeric-status-keys-without-description
Every response must have a description.
$.paths[*][get,put,post,delete,patch,head,options].responses[*]
error
fastly-server-url-https
Servers must use https.
$.servers[*].url
error
fastly-info-required
Every spec must define info.title, info.description, and info.version.
$.info

Spectral Ruleset

Raw ↑
extends: ["spectral:oas"]

documentationUrl: https://github.com/api-evangelist/fastly/blob/main/rules/fastly-rules.yml

rules:
  # Fastly conventions
  fastly-operation-tag-required:
    description: Every operation must have at least one tag matching a Fastly API surface.
    severity: error
    given: $.paths[*][get,put,post,delete,patch,head,options]
    then:
      field: tags
      function: schema
      functionOptions:
        schema:
          type: array
          minItems: 1

  fastly-operation-summary-title-case:
    description: Operation summaries must use Title Case.
    severity: warn
    given: $.paths[*][get,put,post,delete,patch,head,options].summary
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-zA-Z0-9]*)( [A-Z][a-zA-Z0-9]*)*$"

  fastly-operationid-camel-case:
    description: operationId must be lowerCamelCase.
    severity: warn
    given: $.paths[*][get,put,post,delete,patch,head,options].operationId
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  fastly-fastly-key-security:
    description: Operations should be secured via the Fastly-Key API key header.
    severity: info
    given: $
    then:
      field: components.securitySchemes
      function: truthy

  fastly-no-numeric-status-keys-without-description:
    description: Every response must have a description.
    severity: error
    given: $.paths[*][get,put,post,delete,patch,head,options].responses[*]
    then:
      field: description
      function: truthy

  fastly-server-url-https:
    description: Servers must use https.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: "^https://"

  fastly-info-required:
    description: Every spec must define info.title, info.description, and info.version.
    severity: error
    given: $.info
    then:
      - field: title
        function: truthy
      - field: description
        function: truthy
      - field: version
        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/fastly-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.