SonarQube · API Governance Rules

SonarQube API Rules

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

9 Rules error 2 warn 4 info 3
View Rules File View on GitHub

Rule Categories

sonarqube

Rules

warn
sonarqube-operation-summary-title-case
All operation summaries must use Title Case
$.paths[*][*].summary
error
sonarqube-operation-id-required
All operations must have an operationId
$.paths[*][get,post,put,patch,delete]
warn
sonarqube-tags-required
All operations must be tagged
$.paths[*][get,post,put,patch,delete]
error
sonarqube-200-response-for-get
All GET operations must define a 200 response
$.paths[*].get.responses
warn
sonarqube-security-on-protected-routes
Non-public endpoints must define security requirements
$.paths[*][get,post,put,patch,delete]
info
sonarqube-paging-params-on-list
List/search operations should support pagination parameters
$.paths[*search*].get.parameters[*].name
warn
sonarqube-response-schema-defined
Successful GET responses should have schemas defined
$.paths[*].get.responses[200].content
info
sonarqube-form-encoded-post
SonarQube POST endpoints use form-encoded bodies
$.paths[*].post.requestBody.content
info
sonarqube-component-key-param
Component-scoped endpoints should use 'component' or 'project' parameter
$.paths[*].get.parameters[*].name

Spectral Ruleset

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

  sonarqube-operation-id-required:
    description: All operations must have an operationId
    message: Operation must have an operationId
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  sonarqube-tags-required:
    description: All operations must be tagged
    message: Operation must have at least one tag
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

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

  sonarqube-security-on-protected-routes:
    description: Non-public endpoints must define security requirements
    message: Protected operation must define security schemes
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: security
      function: truthy

  sonarqube-paging-params-on-list:
    description: List/search operations should support pagination parameters
    message: Search/list operations should include 'p' and 'ps' pagination parameters
    severity: info
    given: "$.paths[*search*].get.parameters[*].name"
    then:
      function: enumeration
      functionOptions:
        values: [q, p, ps, filter, f]

  sonarqube-response-schema-defined:
    description: Successful GET responses should have schemas defined
    message: Response 200 should include a content schema
    severity: warn
    given: "$.paths[*].get.responses[200].content"
    then:
      function: truthy

  sonarqube-form-encoded-post:
    description: SonarQube POST endpoints use form-encoded bodies
    message: >-
      SonarQube API POST endpoints use application/x-www-form-urlencoded,
      not application/json
    severity: info
    given: "$.paths[*].post.requestBody.content"
    then:
      function: truthy

  sonarqube-component-key-param:
    description: Component-scoped endpoints should use 'component' or 'project' parameter
    message: Component-scoped operations should use 'component' or 'project' parameter name
    severity: info
    given: "$.paths[*].get.parameters[*].name"
    then:
      function: enumeration
      functionOptions:
        values: [component, project, componentKeys, projectKey, key]

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