Spring Boot Admin Console · API Governance Rules

Spring Boot Admin Console API Rules

Spectral linting rules defining API design standards and conventions for Spring Boot Admin Console.

8 Rules error 3 warn 4 info 1
View Rules File View on GitHub

Rule Categories

sba

Rules

error
sba-operationid-required
All Spring Boot Admin API operations must have an operationId.
$.paths[*][get,post,put,delete,patch]
warn
sba-operationid-camelcase
OperationIds must use camelCase.
$.paths[*][get,post,put,delete,patch].operationId
error
sba-tags-required
All operations must have at least one tag.
$.paths[*][get,post,put,delete,patch]
error
sba-get-response-200
All GET operations must define a 200 response.
$.paths[*].get.responses
warn
sba-delete-response-204
DELETE operations should return 204 No Content on success.
$.paths[*].delete.responses
warn
sba-schema-description
All named schemas should have a description.
$.components.schemas[*]
info
sba-instance-id-path-param
Instance ID path parameters should be named 'id'.
$.paths['/instances/{id}'][*].parameters[*]
warn
sba-status-enum-defined
Status fields in response schemas should define an enum of valid values.
$.components.schemas[*].properties.status

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  sba-operationid-required:
    description: All Spring Boot Admin API operations must have an operationId.
    message: "OperationId is required for every operation."
    severity: error
    given: "$.paths[*][get,post,put,delete,patch]"
    then:
      field: operationId
      function: truthy

  sba-operationid-camelcase:
    description: OperationIds must use camelCase.
    message: "OperationId '{{value}}' must use camelCase."
    severity: warn
    given: "$.paths[*][get,post,put,delete,patch].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

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

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

  sba-delete-response-204:
    description: DELETE operations should return 204 No Content on success.
    message: "DELETE operation should define a 204 No Content response."
    severity: warn
    given: "$.paths[*].delete.responses"
    then:
      field: "204"
      function: truthy

  sba-schema-description:
    description: All named schemas should have a description.
    message: "Schema '{{property}}' is missing a description."
    severity: warn
    given: "$.components.schemas[*]"
    then:
      field: description
      function: truthy

  sba-instance-id-path-param:
    description: Instance ID path parameters should be named 'id'.
    message: "Instance path parameter should be named 'id'."
    severity: info
    given: "$.paths['/instances/{id}'][*].parameters[*]"
    then:
      field: name
      function: pattern
      functionOptions:
        match: "^id$"

  sba-status-enum-defined:
    description: Status fields in response schemas should define an enum of valid values.
    message: "Status field should define valid Spring Boot Admin status enum values."
    severity: warn
    given: "$.components.schemas[*].properties.status"
    then:
      field: enum
      function: truthy