Apache ServiceMix · API Governance Rules

Apache ServiceMix API Rules

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

6 Rules error 4 warn 2
View Rules File View on GitHub

Rule Categories

apache

Rules

error
apache-servicemix-info-title-required
Info object must have a title
$.info
error
apache-servicemix-operation-summary-required
All operations must have a summary
$.paths[*][*]
error
apache-servicemix-operation-operationId-required
All operations must have an operationId
$.paths[*][*]
warn
apache-servicemix-operation-tags-required
All operations must have tags
$.paths[*][*]
warn
apache-servicemix-operation-summary-apache-prefix
Operation summaries should be prefixed with Apache ServiceMix
$.paths[*][*].summary
error
apache-servicemix-response-success-required
All operations must have a success response
$.paths[*][*].responses

Spectral Ruleset

Raw ↑
rules:
  apache-servicemix-info-title-required:
    description: Info object must have a title
    message: API must have a title in the info object
    severity: error
    given: $.info
    then:
      field: title
      function: truthy
  apache-servicemix-operation-summary-required:
    description: All operations must have a summary
    message: Operation must have a summary
    severity: error
    given: $.paths[*][*]
    then:
      field: summary
      function: truthy
  apache-servicemix-operation-operationId-required:
    description: All operations must have an operationId
    message: Operation must have an operationId
    severity: error
    given: $.paths[*][*]
    then:
      field: operationId
      function: truthy
  apache-servicemix-operation-tags-required:
    description: All operations must have tags
    message: Operation must have at least one tag
    severity: warn
    given: $.paths[*][*]
    then:
      field: tags
      function: truthy
  apache-servicemix-operation-summary-apache-prefix:
    description: Operation summaries should be prefixed with Apache ServiceMix
    message: Summary should start with "Apache ServiceMix"
    severity: warn
    given: $.paths[*][*].summary
    then:
      function: pattern
      functionOptions:
        match: "^Apache ServiceMix"
  apache-servicemix-response-success-required:
    description: All operations must have a success response
    message: Operation must define a 2xx response
    severity: error
    given: $.paths[*][*].responses
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
            - required: ["200"]
            - required: ["201"]
            - required: ["204"]