RouterOS · API Governance Rules

RouterOS API Rules

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

10 Rules warn 6 info 2
View Rules File View on GitHub

Rule Categories

routeros

Rules

warn
routeros-operation-summary-title-case
Operation summaries must use Title Case.
$.paths[*][*].summary
warn
routeros-operationid-kebab-case
operationId must use camelCase (RouterOS convention).
$.paths[*][*].operationId
warn
routeros-path-kebab-case
API paths must use kebab-case segments mirroring RouterOS menu hierarchy.
$.paths[*]~
warn
routeros-tags-title-case
All tags must use Title Case.
$.paths[*][*].tags[*]
warn
routeros-response-200-schema
GET operations must return a schema in 200 responses.
$.paths[*].get.responses['200'].content[*].schema
warn
routeros-security-basic-auth
RouterOS REST API uses HTTP Basic Auth; security must be defined.
$.paths[*][*]
hint
routeros-error-schema-defined
Error responses must reference the Error schema component.
$.paths[*][*].responses['4XX','5XX'].content[*].schema
info
routeros-put-for-create
RouterOS uses PUT (not POST) for creating resources.
$.paths[*].post
hint
routeros-id-path-param-star-prefix
RouterOS IDs use asterisk-prefixed strings (e.g., *1). Document this in examples.
$.paths[*][*].parameters[?(@.name == 'id')].example
info
routeros-string-typed-values
RouterOS returns all values as strings even for numeric/boolean properties.
$.components.schemas[*].properties[?(@.type == 'boolean')]

Spectral Ruleset

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

  routeros-operationid-kebab-case:
    description: operationId must use camelCase (RouterOS convention).
    message: "operationId '{{value}}' must use camelCase."
    severity: warn
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  routeros-path-kebab-case:
    description: API paths must use kebab-case segments mirroring RouterOS menu hierarchy.
    message: "Path segment '{{value}}' must use kebab-case."
    severity: warn
    given: "$.paths[*]~"
    then:
      function: pattern
      functionOptions:
        match: "^(/[a-z][a-z0-9-]*(\\{[a-zA-Z][a-zA-Z0-9-]*\\})?)*$"

  routeros-tags-title-case:
    description: All tags must use Title Case.
    message: "Tag '{{value}}' must use Title Case."
    severity: warn
    given: "$.paths[*][*].tags[*]"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9\\s]*$"

  routeros-response-200-schema:
    description: GET operations must return a schema in 200 responses.
    message: "GET operation '{{path}}' must define a schema for the 200 response."
    severity: warn
    given: "$.paths[*].get.responses['200'].content[*].schema"
    then:
      function: truthy

  routeros-security-basic-auth:
    description: RouterOS REST API uses HTTP Basic Auth; security must be defined.
    message: "Operation must reference a security scheme (RouterOS uses basicAuth)."
    severity: warn
    given: "$.paths[*][*]"
    then:
      function: truthy
      field: security
      severity: hint

  routeros-error-schema-defined:
    description: Error responses must reference the Error schema component.
    message: "Error response should reference the Error schema."
    severity: hint
    given: "$.paths[*][*].responses['4XX','5XX'].content[*].schema"
    then:
      function: truthy

  routeros-put-for-create:
    description: RouterOS uses PUT (not POST) for creating resources.
    message: "Use PUT for creating RouterOS resources; POST is reserved for console commands."
    severity: info
    given: "$.paths[*].post"
    then:
      function: falsy
      severity: hint

  routeros-id-path-param-star-prefix:
    description: RouterOS IDs use asterisk-prefixed strings (e.g., *1). Document this in examples.
    message: "Path parameter 'id' should document the RouterOS *N ID format."
    severity: hint
    given: "$.paths[*][*].parameters[?(@.name == 'id')].example"
    then:
      function: pattern
      functionOptions:
        match: "^\\*[0-9]+$"

  routeros-string-typed-values:
    description: RouterOS returns all values as strings even for numeric/boolean properties.
    message: "RouterOS API returns all values as strings. Document boolean-like fields with enum ['true','false']."
    severity: info
    given: "$.components.schemas[*].properties[?(@.type == 'boolean')]"
    then:
      function: falsy

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