Spectral · JSON Structure

Spectral Ruleset Structure

Hierarchical structure of a Spectral ruleset configuration.

Type: object Properties: 0
API DesignAPI LintingAPI Style GuideAsyncAPIJSON-SchemaOpenAPIQuality Assurance

Spectral Ruleset Structure is a JSON Structure definition published by Spectral.

Meta-schema:

JSON Structure

spectral-ruleset-structure.json Raw ↑
{
  "title": "Spectral Ruleset Structure",
  "description": "Hierarchical structure of a Spectral ruleset configuration.",
  "type": "object",
  "fields": [
    {
      "name": "extends",
      "type": "string | string[]",
      "required": false,
      "description": "Parent ruleset(s) to inherit rules from (npm package names or URLs)."
    },
    {
      "name": "rules",
      "type": "object",
      "required": false,
      "description": "Map of rule name to rule definition.",
      "children": [
        {
          "name": "{rule-name}",
          "type": "object",
          "fields": [
            { "name": "description", "type": "string", "required": false },
            { "name": "message", "type": "string", "required": false },
            {
              "name": "severity",
              "type": "enum",
              "values": ["error", "warn", "info", "hint", "off", 0, 1, 2, 3],
              "required": false
            },
            {
              "name": "given",
              "type": "string | string[]",
              "required": true,
              "description": "JSONPath expression(s) selecting document nodes to test."
            },
            {
              "name": "then",
              "type": "object | object[]",
              "required": true,
              "fields": [
                { "name": "field", "type": "string", "required": false },
                { "name": "function", "type": "string", "required": true },
                { "name": "functionOptions", "type": "object", "required": false }
              ]
            },
            {
              "name": "formats",
              "type": "string[]",
              "required": false,
              "description": "Limit rule to specific document formats."
            },
            {
              "name": "recommended",
              "type": "boolean",
              "required": false
            }
          ]
        }
      ]
    },
    {
      "name": "aliases",
      "type": "object",
      "required": false,
      "description": "Named JSONPath expressions for reuse across rules."
    },
    {
      "name": "overrides",
      "type": "array",
      "required": false,
      "description": "Per-file rule severity overrides.",
      "items": {
        "fields": [
          { "name": "files", "type": "string[]", "required": true },
          { "name": "rules", "type": "object", "required": true }
        ]
      }
    },
    {
      "name": "formats",
      "type": "string[]",
      "required": false,
      "description": "Restrict the entire ruleset to specific document formats."
    }
  ]
}

Work with this as data

Every JSON Structure 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 json structure

4 MCP tools reach this
  • find_json_structuresBrowse and filter every JSON Structure 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 JSON Structure
curl "https://apis.io/api/v1/json-structures/spectral-ruleset-structure"
All json structure
curl "https://apis.io/api/v1/json-structures?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.