Microcks · API Governance Rules

Microcks — microcks spectral ruleset rules

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

11 Rules warn 10 info 1
Published by Microcks Served by the provider at https://github.com/microcks/microcks-spectral-ruleset/blob/b42c0030c31e6fb64e66b6f17ebb8be1b75ceb3d/microcks-rules.yaml; the copy below was fetched from there.
View Rules File View on GitHub

Rule Categories

microcks

Rules

warn
microcks-info-extension-valid
x-microcks extension must be valid
$.info.x-microcks
warn
microcks-operation-extension-valid
x-microcks-operation extension must be valid
$.paths.*.*.x-microcks-operation$.channels.*.[publish,subscribe].x-microcks-operation$.operations.*.x-microcks-operation
warn
microcks-examples-in-required-parameter
Required param must have examples
$..parameters[?(@ && @.required == true)]
info
microcks-examples-in-optional-parameter
Optional param should have examples
$..parameters[?(@ && @.required != true)]
warn
microcks-examples-in-request-content
Request with content must have examples
$.paths..requestBody..content.*
warn
microcks-examples-in-response-content
Response with content must have examples
$.paths..responses..content.*
warn
microcks-examples-fragments-to-complete-mocks
Response example must match required params examples to form full mocks
$.paths.*.*
warn
microcks-aas-examples-in-messages
Message must have examples
$.channels.*.[publish,subscribe].message
warn
microcks-aas3-examples-in-messages
Message must have examples
$.components.messages.*
warn
microcks-aas-examples-in-parameter
Parameter must have examples
$.channels.*.parameters.*.schema
warn
microcks-aas-examples-fragments-to-complete-mocks
Message example must match params examples to form full mocks
$.channels.*

Spectral Ruleset

Raw ↑
# harvested from https://github.com/microcks/microcks-spectral-ruleset/blob/b42c0030c31e6fb64e66b6f17ebb8be1b75ceb3d/microcks-rules.yaml on 2026-10-09 — a Spectral ruleset published in the provider's own GitHub repository (microcks/microcks-spectral-ruleset); found by GitHub code search, fetched verbatim
x-method: harvested
x-stamped: 2026-10-09
x-source-url: https://github.com/microcks/microcks-spectral-ruleset/blob/b42c0030c31e6fb64e66b6f17ebb8be1b75ceb3d/microcks-rules.yaml
functions:
  - oas-verify-mocks
  - aas-verify-mocks

extends: [[spectral:oas, off], [spectral:asyncapi, off]]

rules:
  microcks-info-extension-valid:
    description: x-microcks extension must be valid
    message: "x-microcks extension must be valid"
    formats:
      - oas3
      - aas2
      - aas3
    severity: warn
    given: "$.info.x-microcks"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            labels:
              type: object
              additionalProperties:
                type: string
          required:
            - labels
          additionalProperties: false

  microcks-operation-extension-valid:
    description: x-microcks-operation extension must be valid
    message: "x-microcks-operation extension must be valid"
    formats:
      - oas3
      - aas2
      - aas3
    severity: warn
    given: 
      - "$.paths.*.*.x-microcks-operation"
      - "$.channels.*.[publish,subscribe].x-microcks-operation"
      - "$.operations.*.x-microcks-operation"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            delay:
              type: number
              format: int32
            frequency:
              type: number
              format: int32
            dispatcher:
              type: string
            dispatcherRules:
              type: string
            parameterConstraints:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  in:
                    type: string
                    enum: [path, query, header]
                  required:
                    type: boolean
                  recopy:
                    type: boolean
                  mustMatchRegexp:
                    type: string
                required:
                  - name
                  - in
          additionalProperties: false

  oas3-valid-media-example: true
  oas3-valid-schema-example: true

  microcks-examples-in-required-parameter:
    description: Required param must have examples
    message: "Required param must have examples"
    formats:
      - oas3
    severity: warn
    given: "$..parameters[?(@ && @.required == true)]"
    then:
      field: examples
      function: truthy

  microcks-examples-in-optional-parameter:
    description: Optional param should have examples
    message: "Optional param should have examples"
    formats:
      - oas3
    severity: info
    given: "$..parameters[?(@ && @.required != true)]"
    then:
      field: examples
      function: truthy

  microcks-examples-in-request-content:
    description: Request with content must have examples
    message: "Request with content must have examples"
    formats:
      - oas3
    severity: warn
    given: "$.paths..requestBody..content.*"
    then:
      field: examples
      function: truthy

  microcks-examples-in-response-content:
    description: Response with content must have examples
    message: "Response with content must have examples"
    formats:
      - oas3
    severity: warn
    given: "$.paths..responses..content.*"
    then:
      field: examples
      function: truthy

  microcks-examples-fragments-to-complete-mocks:
    description: Response example must match required params examples to form full mocks
    message: "{{error}}"
    formats:
      - oas3
    severity: warn
    given: "$.paths.*.*"
    then:
      function: oas-verify-mocks
          
  asyncapi-message-examples: true

  microcks-aas-examples-in-messages:
    description: Message must have examples
    message: "Message must have examples"
    formats:
      - aas2
    severity: warn
    given: "$.channels.*.[publish,subscribe].message"
    then:
      field: examples
      function: truthy

  microcks-aas3-examples-in-messages:
    description: Message must have examples
    message: "Message must have examples"
    formats:
      - aas3
    severity: warn
    given: "$.components.messages.*"
    then:
      field: examples
      function: truthy

  microcks-aas-examples-in-parameter:
    description: Parameter must have examples
    message: "Parameter must have examples"
    formats:
      - aas2
    severity: warn
    given: "$.channels.*.parameters.*.schema"
    then:
      field: examples
      function: truthy

  microcks-aas-examples-fragments-to-complete-mocks:
    description: Message example must match params examples to form full mocks
    message: "{{error}}"
    formats:
      - aas2
    severity: warn
    given: "$.channels.*"
    then:
      function: aas-verify-mocks

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/microcks-microcks-spectral-ruleset-spectral-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.