Cribl · API Governance Rules

Cribl API Rules

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

6 Rules error 5 warn 1
View Rules File View on GitHub

Rule Categories

cribl

Rules

error
cribl-cloud-info-contact
API info object should reference Cribl support contact.
$.info.contact
warn
cribl-cloud-server-cribl-cloud
Server URL should reference cribl.cloud workspace pattern or on-prem deployment.
$.servers[*].url
error
cribl-cloud-bearer-auth
API must declare bearerAuth security scheme for Bearer tokens.
$.components.securitySchemes
error
cribl-cloud-required-paths
Cloud API must define authentication, health, and core resource paths.
$.paths
error
cribl-cloud-operation-id
All operations must define an operationId.
$.paths.*.*
error
cribl-cloud-tags
All operations must define tags.
$.paths.*.*

Spectral Ruleset

Raw ↑
extends: ["spectral:oas"]
documentationUrl: https://docs.cribl.io/api-reference/
rules:
  cribl-cloud-info-contact:
    description: API info object should reference Cribl support contact.
    given: "$.info.contact"
    severity: error
    then:
      field: url
      function: pattern
      functionOptions:
        match: "cribl"
  cribl-cloud-server-cribl-cloud:
    description: Server URL should reference cribl.cloud workspace pattern or on-prem deployment.
    given: "$.servers[*].url"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "(cribl\\.cloud|api/v1)"
  cribl-cloud-bearer-auth:
    description: API must declare bearerAuth security scheme for Bearer tokens.
    given: "$.components.securitySchemes"
    severity: error
    then:
      field: bearerAuth
      function: truthy
  cribl-cloud-required-paths:
    description: Cloud API must define authentication, health, and core resource paths.
    given: "$.paths"
    severity: error
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required:
            - /auth/login
            - /health
            - /system/sources
  cribl-cloud-operation-id:
    description: All operations must define an operationId.
    given: "$.paths.*.*"
    severity: error
    then:
      field: operationId
      function: truthy
  cribl-cloud-tags:
    description: All operations must define tags.
    given: "$.paths.*.*"
    severity: error
    then:
      field: tags
      function: truthy