Spring Data · API Governance Rules

Spring Data API Rules

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

7 Rules error 1 warn 4 info 2
View Rules File View on GitHub

Rule Categories

spring

Rules

warn
spring-data-hal-content-type
Spring Data REST endpoints should accept/produce application/hal+json
$.paths[*][*].responses[*].content
info
spring-data-pageable-parameters
Collection endpoints should support page, size, and sort query parameters
$.paths[*].get
error
spring-data-rest-operation-ids
All operations must have a unique operationId
$.paths[*][get,post,put,patch,delete]
warn
spring-data-rest-tags
Operations must include at least one tag using Title Case
$.paths[*][get,post,put,patch,delete]
warn
spring-data-no-trailing-slashes
API paths must not have trailing slashes
$.paths
info
spring-data-hateoas-links
Resource schemas should include _links property for HATEOAS compliance
$.components.schemas[*]
warn
spring-data-rest-summaries-title-case
Operation summaries must use Title Case
$.paths[*][*].summary

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  spring-data-hal-content-type:
    description: Spring Data REST endpoints should accept/produce application/hal+json
    message: "{{description}}. Found: {{value}}"
    severity: warn
    given: "$.paths[*][*].responses[*].content"
    then:
      field: "application/hal+json"
      function: truthy

  spring-data-pageable-parameters:
    description: Collection endpoints should support page, size, and sort query parameters
    message: "Collection GET operations should include page, size, and sort parameters"
    severity: info
    given: "$.paths[*].get"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

  spring-data-rest-operation-ids:
    description: All operations must have a unique operationId
    message: "Operation is missing operationId"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  spring-data-rest-tags:
    description: Operations must include at least one tag using Title Case
    message: "Operation must have tags"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  spring-data-no-trailing-slashes:
    description: API paths must not have trailing slashes
    message: "Path {{path}} has a trailing slash"
    severity: warn
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        notMatch: "/$"

  spring-data-hateoas-links:
    description: Resource schemas should include _links property for HATEOAS compliance
    message: "Resource schemas should define _links property"
    severity: info
    given: "$.components.schemas[*]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

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

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-data-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.