Spring Integration · API Governance Rules

Spring Integration API Rules

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

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

Rule Categories

spring

Rules

error
spring-integration-operation-id
All operations must have operationId
$.paths[*][get,post,put,patch,delete]
warn
spring-integration-tags-required
Operations must include at least one tag
$.paths[*][get,post,put,patch,delete]
warn
spring-integration-summary-title-case
Summaries must use Title Case
$.paths[*][*].summary
info
spring-integration-management-paths
Management API paths should be descriptive and use kebab-case
$.paths
warn
spring-integration-response-descriptions
All responses should have descriptions
$.paths[*][*].responses[*]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  spring-integration-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-integration-tags-required:
    description: Operations must include at least one tag
    message: "Operation at {{path}} must have tags"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  spring-integration-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-integration-management-paths:
    description: Management API paths should be descriptive and use kebab-case
    message: "Path should use kebab-case segments"
    severity: info
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        match: "^(/[a-z][a-zA-Z0-9]*({[^}]+})?)*$"

  spring-integration-response-descriptions:
    description: All responses should have descriptions
    message: "Response at {{path}} is missing description"
    severity: warn
    given: "$.paths[*][*].responses[*]"
    then:
      field: description
      function: truthy