RAWG · API Governance Rules

RAWG API Rules

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

8 Rules error 2 warn 4 info 2
View Rules File View on GitHub

Rule Categories

rawg

Rules

warn
rawg-operation-summary-title-case
All operation summaries must use Title Case
$.paths[*][*].summary
error
rawg-operation-must-have-tags
Every operation must have at least one tag
$.paths[*][*]
warn
rawg-path-kebab-case
Path segments should use kebab-case
$.paths[*]~
warn
rawg-apikey-required
All operations must declare the key query parameter
$.paths[*][get].parameters[*]
error
rawg-responses-200-required
All GET operations must define a 200 response
$.paths[*].get
info
rawg-pagination-parameters
List operations should support page and page_size parameters
$.paths[*].get
warn
rawg-no-trailing-slash
Paths must not have trailing slashes
$.paths[*]~
info
rawg-operationid-consistent-naming
OperationIds should follow provider pattern of resource_action
$.paths[*][*].operationId

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  rawg-operation-summary-title-case:
    description: All operation summaries must use Title Case
    message: "Summary '{{value}}' must be Title Case"
    given: "$.paths[*][*].summary"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-z0-9]*([ ][A-Z][a-z0-9]*)*|[A-Z]+)$"

  rawg-operation-must-have-tags:
    description: Every operation must have at least one tag
    message: Operations must include at least one tag
    given: "$.paths[*][*]"
    severity: error
    then:
      field: tags
      function: truthy

  rawg-path-kebab-case:
    description: Path segments should use kebab-case
    message: "Path '{{path}}' should use kebab-case segments"
    given: "$.paths[*]~"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^(\\/([a-z][a-z0-9-]*|\\{[a-zA-Z_]+\\}))+$"

  rawg-apikey-required:
    description: All operations must declare the key query parameter
    message: Operations must include the API key query parameter
    given: "$.paths[*][get].parameters[*]"
    severity: warn
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          if:
            properties:
              name:
                const: key
          then:
            properties:
              in:
                const: query

  rawg-responses-200-required:
    description: All GET operations must define a 200 response
    message: GET operations must have a 200 response defined
    given: "$.paths[*].get"
    severity: error
    then:
      field: responses.200
      function: truthy

  rawg-pagination-parameters:
    description: List operations should support page and page_size parameters
    message: List operations should include pagination parameters
    given: "$.paths[*].get"
    severity: info
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            operationId:
              pattern: "_list$"

  rawg-no-trailing-slash:
    description: Paths must not have trailing slashes
    message: "Path '{{path}}' must not have a trailing slash"
    given: "$.paths[*]~"
    severity: warn
    then:
      function: pattern
      functionOptions:
        notMatch: "\\/$"

  rawg-operationid-consistent-naming:
    description: OperationIds should follow provider pattern of resource_action
    message: "OperationId '{{value}}' should follow the pattern resource_action"
    given: "$.paths[*][*].operationId"
    severity: info
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-z0-9-]*_[a-z][a-z0-9-]*"

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/rawg-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.