Mockaroo · API Governance Rules

Mockaroo API Rules

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

10 Rules error 7 warn 3
View Rules File View on GitHub

Rule Categories

mockaroo

Rules

error
mockaroo-info-contact
Mockaroo specs must declare a contact block pointing at support.
$.info
warn
mockaroo-info-license
Mockaroo specs must declare a license / terms entry.
$.info
error
mockaroo-server-host
Mockaroo's production host must be api.mockaroo.com.
$.servers[*].url
error
mockaroo-api-prefix
All Mockaroo paths must live under the /api/ prefix.
$.paths
error
mockaroo-operation-id
Every operation requires an operationId in lowerCamelCase.
$.paths[*][get,post,put,delete,patch]
warn
mockaroo-summary-title-case
Operation summaries must use Title Case (each significant word capitalized).
$.paths[*][get,post,put,delete,patch].summary
error
mockaroo-tag-required
Operations must declare at least one tag.
$.paths[*][get,post,put,delete,patch]
error
mockaroo-api-key-security
The root security must include the api-key scheme (query or header).
$.components.securitySchemes
error
mockaroo-generate-format-suffix
Generate endpoints must encode the output format as a path suffix (.json, .csv, .txt, .custom, .sql, .xml).
$.paths[?(@property.match(/^\/api\/generate/))]~
warn
mockaroo-rate-limit-response
Every operation must declare a 429 response since Mockaroo enforces daily quotas.
$.paths[*][get,post,put,delete,patch].responses

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
documentationUrl: https://www.mockaroo.com/docs
description: >-
  Spectral ruleset capturing Mockaroo API conventions: api-key authentication,
  /api/* path prefix, format-encoded generate endpoints, and Title Case operation
  summaries.
rules:
  mockaroo-info-contact:
    description: Mockaroo specs must declare a contact block pointing at support.
    severity: error
    given: $.info
    then:
      field: contact
      function: truthy

  mockaroo-info-license:
    description: Mockaroo specs must declare a license / terms entry.
    severity: warn
    given: $.info
    then:
      field: license
      function: truthy

  mockaroo-server-host:
    description: Mockaroo's production host must be api.mockaroo.com.
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: ^https://api\.mockaroo\.com/?$

  mockaroo-api-prefix:
    description: All Mockaroo paths must live under the /api/ prefix.
    severity: error
    given: $.paths
    then:
      field: '@key'
      function: pattern
      functionOptions:
        match: ^/api/.+

  mockaroo-operation-id:
    description: Every operation requires an operationId in lowerCamelCase.
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      - field: operationId
        function: truthy
      - field: operationId
        function: pattern
        functionOptions:
          match: ^[a-z][a-zA-Z0-9]+$

  mockaroo-summary-title-case:
    description: Operation summaries must use Title Case (each significant word capitalized).
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].summary
    then:
      function: pattern
      functionOptions:
        match: ^([A-Z][a-zA-Z0-9]*)(\s+(?:[A-Z][a-zA-Z0-9]*|a|an|and|as|at|but|by|for|in|of|on|or|the|to|with))+$

  mockaroo-tag-required:
    description: Operations must declare at least one tag.
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: tags
      function: length
      functionOptions:
        min: 1

  mockaroo-api-key-security:
    description: The root security must include the api-key scheme (query or header).
    severity: error
    given: $.components.securitySchemes
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          anyOf:
            - required: [apiKeyQuery]
            - required: [apiKeyHeader]

  mockaroo-generate-format-suffix:
    description: Generate endpoints must encode the output format as a path suffix (.json, .csv, .txt, .custom, .sql, .xml).
    severity: error
    given: $.paths[?(@property.match(/^\/api\/generate/))]~
    then:
      function: pattern
      functionOptions:
        match: ^/api/generate\.(json|csv|txt|custom|sql|xml)$

  mockaroo-rate-limit-response:
    description: Every operation must declare a 429 response since Mockaroo enforces daily quotas.
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].responses
    then:
      field: '429'
      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/mockaroo-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.