Spring Security · API Governance Rules

Spring Security API Rules

Spectral linting rules defining API design standards and conventions for Spring Security.

7 Rules error 3 warn 3 info 1
View Rules File View on GitHub

Rule Categories

spring

Rules

error
spring-security-operation-id
All operations must have operationId
$.paths[*][get,post,put,patch,delete]
warn
spring-security-tags-required
All operations must have tags
$.paths[*][get,post,put,patch,delete]
warn
spring-security-summary-title-case
Summaries must use Title Case
$.paths[*][*].summary
warn
spring-security-oauth2-error-responses
OAuth2 token endpoints must define error response schemas
$.paths[/oauth2/token,/oauth2/introspect].post
error
spring-security-security-schemes
API should define security schemes
$.components
info
spring-security-bearer-format
Bearer auth scheme should specify bearerFormat
$.components.securitySchemes[*][?(@.scheme == 'bearer')]
error
spring-security-sensitive-endpoints-documented
Sensitive OAuth2 endpoints must have descriptions
$.paths[/oauth2/token,/oauth2/introspect,/oauth2/revoke,/oauth2/authorize][*]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  spring-security-operation-id:
    description: All operations must have operationId
    message: "Missing operationId at {{path}}"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  spring-security-tags-required:
    description: All operations must have tags
    message: "Operation at {{path}} must have tags"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  spring-security-summary-title-case:
    description: Summaries must use Title Case
    message: "Summary '{{value}}' should use Title Case"
    severity: warn
    given: "$.paths[*][*].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z]"

  spring-security-oauth2-error-responses:
    description: OAuth2 token endpoints must define error response schemas
    message: "Token endpoint should define 400 error response at {{path}}"
    severity: warn
    given: "$.paths[/oauth2/token,/oauth2/introspect].post"
    then:
      field: "responses.400"
      function: truthy

  spring-security-security-schemes:
    description: API should define security schemes
    message: "API must define securitySchemes in components"
    severity: error
    given: "$.components"
    then:
      field: securitySchemes
      function: truthy

  spring-security-bearer-format:
    description: Bearer auth scheme should specify bearerFormat
    message: "Bearer security scheme should specify bearerFormat: JWT"
    severity: info
    given: "$.components.securitySchemes[*][?(@.scheme == 'bearer')]"
    then:
      field: bearerFormat
      function: truthy

  spring-security-sensitive-endpoints-documented:
    description: Sensitive OAuth2 endpoints must have descriptions
    message: "OAuth2 endpoint at {{path}} must have description"
    severity: error
    given: "$.paths[/oauth2/token,/oauth2/introspect,/oauth2/revoke,/oauth2/authorize][*]"
    then:
      field: description
      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/spring-security-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 email required.

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