Apache Geode · API Governance Rules

Apache Geode API Rules

Spectral linting rules defining API design standards and conventions for Apache Geode.

9 Rules error 4 warn 4 info 1
View Rules File View on GitHub

Rule Categories

info operation parameter paths response

Rules

error
info-title-required
Info title must be defined
$.info
error
info-version-required
API version must be specified
$.info
error
operation-summary-required
All operations must have a summary
$.paths[*][get,post,put,delete,patch]
warn
operation-summary-apache-geode-prefix
Operation summaries should start with Apache Geode
$.paths[*][get,post,put,delete,patch].summary
error
operation-operationId-required
All operations must have an operationId
$.paths[*][get,post,put,delete,patch]
warn
operation-tags-required
Operations should have tags
$.paths[*][get,post,put,delete,patch]
info
paths-versioned
Paths should include API version prefix
$.paths
warn
response-description-required
All responses must have descriptions
$.paths[*][get,post,put,delete,patch].responses[*]
warn
parameter-description-required
All parameters must have descriptions
$.paths[*][get,post,put,delete,patch].parameters[*]

Spectral Ruleset

Raw ↑
# Apache Geode REST API Spectral Ruleset
rules:
  info-title-required:
    description: Info title must be defined
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  info-version-required:
    description: API version must be specified
    severity: error
    given: $.info
    then:
      field: version
      function: truthy
  operation-summary-required:
    description: All operations must have a summary
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: summary
      function: truthy
  operation-summary-apache-geode-prefix:
    description: Operation summaries should start with Apache Geode
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].summary
    then:
      function: pattern
      functionOptions:
        match: "^Apache Geode"
  operation-operationId-required:
    description: All operations must have an operationId
    severity: error
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: operationId
      function: truthy
  operation-tags-required:
    description: Operations should have tags
    severity: warn
    given: $.paths[*][get,post,put,delete,patch]
    then:
      field: tags
      function: truthy
  paths-versioned:
    description: Paths should include API version prefix
    severity: info
    given: $.paths
    then:
      field: "@key"
      function: pattern
      functionOptions:
        match: "^/geode/v[0-9]+"
  response-description-required:
    description: All responses must have descriptions
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].responses[*]
    then:
      field: description
      function: truthy
  parameter-description-required:
    description: All parameters must have descriptions
    severity: warn
    given: $.paths[*][get,post,put,delete,patch].parameters[*]
    then:
      field: description
      function: truthy