Apache Ignite · API Governance Rules

Apache Ignite API Rules

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

23 Rules error 10 warn 9 info 4
View Rules File View on GitHub

Rule Categories

examples get info no openapi operation parameter paths response schema security servers

Rules

error
info-title-required
Info title must be present and start with Apache Ignite
$.info
warn
info-description-required
Info must have a description
$.info
error
info-version-required
Info must have a version field
$.info
error
openapi-version
Must use OpenAPI 3.x
$
error
servers-defined
Servers must be defined
$
error
operation-summary-required
Every operation must have a summary
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-summary-prefix
Operation summaries should start with Apache Ignite
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-description-required
Every operation should have a description
$.paths[*][get,post,put,patch,delete,head,options]
error
operation-id-required
Every operation must have an operationId
$.paths[*][get,post,put,patch,delete,head,options]
warn
operation-id-camel-case
operationId should use camelCase
$.paths[*][get,post,put,patch,delete,head,options]
error
operation-tags-required
Every operation must have at least one tag
$.paths[*][get,post,put,patch,delete,head,options]
warn
parameter-description-required
Parameters should have descriptions
$.paths[*][get,post,put,patch,delete,head,options].parameters[*]
error
response-success-required
Every operation must have at least one 2xx response
$.paths[*][get,post,put,patch,delete,head,options].responses
error
response-description-required
Every response must have a description
$.paths[*][get,post,put,patch,delete,head,options].responses[*]
info
schema-description-required
Top-level schemas should have descriptions
$.components.schemas[*]
warn
paths-kebab-case
Path segments should use kebab-case
$.paths
error
get-no-request-body
GET operations must not have a request body
$.paths[*].get
warn
no-empty-descriptions
Descriptions must not be empty
$..description
warn
security-schemes-defined
Security schemes should be defined
$.components
info
response-error-400
POST/PUT operations should document 400 responses
$.paths[*][post,put].responses
info
response-error-404
GET operations should document 404 responses
$.paths[*].get.responses
warn
paths-no-trailing-slash
Paths must not have trailing slashes
$.paths
info
examples-encouraged
Schema properties should include examples
$.components.schemas[*].properties[*]

Spectral Ruleset

Raw ↑
rules:
  info-title-required:
    description: Info title must be present and start with Apache Ignite
    severity: error
    given: "$.info"
    then:
      field: title
      function: pattern
      functionOptions:
        match: "^Apache Ignite"

  info-description-required:
    description: Info must have a description
    severity: warn
    given: "$.info"
    then:
      field: description
      function: truthy

  info-version-required:
    description: Info must have a version field
    severity: error
    given: "$.info"
    then:
      field: version
      function: truthy

  openapi-version:
    description: Must use OpenAPI 3.x
    severity: error
    given: "$"
    then:
      field: openapi
      function: pattern
      functionOptions:
        match: "^3\\."

  servers-defined:
    description: Servers must be defined
    severity: error
    given: "$"
    then:
      field: servers
      function: truthy

  operation-summary-required:
    description: Every operation must have a summary
    severity: error
    given: "$.paths[*][get,post,put,patch,delete,head,options]"
    then:
      field: summary
      function: truthy

  operation-summary-prefix:
    description: Operation summaries should start with Apache Ignite
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete,head,options]"
    then:
      field: summary
      function: pattern
      functionOptions:
        match: "^Apache Ignite"

  operation-description-required:
    description: Every operation should have a description
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete,head,options]"
    then:
      field: description
      function: truthy

  operation-id-required:
    description: Every operation must have an operationId
    severity: error
    given: "$.paths[*][get,post,put,patch,delete,head,options]"
    then:
      field: operationId
      function: truthy

  operation-id-camel-case:
    description: operationId should use camelCase
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete,head,options]"
    then:
      field: operationId
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  operation-tags-required:
    description: Every operation must have at least one tag
    severity: error
    given: "$.paths[*][get,post,put,patch,delete,head,options]"
    then:
      field: tags
      function: truthy

  parameter-description-required:
    description: Parameters should have descriptions
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete,head,options].parameters[*]"
    then:
      field: description
      function: truthy

  response-success-required:
    description: Every operation must have at least one 2xx response
    severity: error
    given: "$.paths[*][get,post,put,patch,delete,head,options].responses"
    then:
      function: schema
      functionOptions:
        schema:
          anyOf:
            - required: ["200"]
            - required: ["201"]
            - required: ["204"]

  response-description-required:
    description: Every response must have a description
    severity: error
    given: "$.paths[*][get,post,put,patch,delete,head,options].responses[*]"
    then:
      field: description
      function: truthy

  schema-description-required:
    description: Top-level schemas should have descriptions
    severity: info
    given: "$.components.schemas[*]"
    then:
      field: description
      function: truthy

  paths-kebab-case:
    description: Path segments should use kebab-case
    severity: warn
    given: "$.paths"
    then:
      field: "@key"
      function: pattern
      functionOptions:
        match: "^(\/([a-z0-9{}_-]+))*$"

  get-no-request-body:
    description: GET operations must not have a request body
    severity: error
    given: "$.paths[*].get"
    then:
      field: requestBody
      function: falsy

  no-empty-descriptions:
    description: Descriptions must not be empty
    severity: warn
    given: "$..description"
    then:
      function: pattern
      functionOptions:
        match: ".+"

  security-schemes-defined:
    description: Security schemes should be defined
    severity: warn
    given: "$.components"
    then:
      field: securitySchemes
      function: truthy

  response-error-400:
    description: POST/PUT operations should document 400 responses
    severity: info
    given: "$.paths[*][post,put].responses"
    then:
      field: "400"
      function: truthy

  response-error-404:
    description: GET operations should document 404 responses
    severity: info
    given: "$.paths[*].get.responses"
    then:
      field: "404"
      function: truthy

  paths-no-trailing-slash:
    description: Paths must not have trailing slashes
    severity: warn
    given: "$.paths"
    then:
      field: "@key"
      function: pattern
      functionOptions:
        notMatch: "\\/$"

  examples-encouraged:
    description: Schema properties should include examples
    severity: info
    given: "$.components.schemas[*].properties[*]"
    then:
      field: example
      function: truthy