SingleStore · API Governance Rules

SingleStore API Rules

Spectral linting rules defining API design standards and conventions for SingleStore.

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

Rule Categories

singlestore

Rules

error
singlestore-bearer-auth
All SingleStore API operations must use Bearer token authentication
$.paths.*.*.security
warn
singlestore-title-case-summaries
All operation summaries must use Title Case
$.paths.*.*.summary
error
singlestore-camel-case-operation-ids
All operationId values must use camelCase
$.paths.*.*.operationId
warn
singlestore-tags-required
All operations must have at least one tag
$.paths.*.*
error
singlestore-https-servers
All server URLs must use HTTPS
$.servers[*].url
warn
singlestore-error-responses
All operations should define error response codes
$.paths.*.*
warn
singlestore-contact-info
API info must include contact information
$.info
info
singlestore-external-docs
API should include external documentation link
$

Spectral Ruleset

Raw ↑
rules:
  singlestore-bearer-auth:
    description: All SingleStore API operations must use Bearer token authentication
    message: "Operation is missing Bearer token security requirement"
    severity: error
    given: "$.paths.*.*.security"
    then:
      function: truthy

  singlestore-title-case-summaries:
    description: All operation summaries must use Title Case
    message: "Summary '{{value}}' should use Title Case"
    severity: warn
    given: "$.paths.*.*.summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z]"

  singlestore-camel-case-operation-ids:
    description: All operationId values must use camelCase
    message: "operationId '{{value}}' should use camelCase"
    severity: error
    given: "$.paths.*.*.operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]+$"

  singlestore-tags-required:
    description: All operations must have at least one tag
    message: "Operation is missing tags"
    severity: warn
    given: "$.paths.*.*"
    then:
      field: tags
      function: truthy

  singlestore-https-servers:
    description: All server URLs must use HTTPS
    message: "Server URL '{{value}}' must use HTTPS"
    severity: error
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://"

  singlestore-error-responses:
    description: All operations should define error response codes
    message: "Operation should define at least a 4xx or 5xx response"
    severity: warn
    given: "$.paths.*.*"
    then:
      field: responses
      function: truthy

  singlestore-contact-info:
    description: API info must include contact information
    message: "API info is missing contact details"
    severity: warn
    given: "$.info"
    then:
      field: contact
      function: truthy

  singlestore-external-docs:
    description: API should include external documentation link
    message: "API is missing externalDocs reference"
    severity: info
    given: "$"
    then:
      field: externalDocs
      function: truthy