Octopus Energy · API Governance Rules

Octopus Energy API Rules

Spectral linting rules defining API design standards and conventions for Octopus Energy.

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

Rule Categories

octopus

Rules

warn
octopus-trailing-slash-path
Octopus Energy Public API paths end with a trailing slash.
$.paths.*~
warn
octopus-title-case-summaries
Operation summaries use Title Case.
$.paths.*.*.summary
error
octopus-https-only-server
Server URLs must be HTTPS.
$.servers.*.url
info
octopus-basic-auth-security
Basic auth is the documented authentication scheme.
$.components.securitySchemes.basicAuth.scheme

Spectral Ruleset

Raw ↑
extends: ["spectral:oas"]
rules:
  octopus-trailing-slash-path:
    description: Octopus Energy Public API paths end with a trailing slash.
    message: "Path '{{value}}' should end with a trailing slash to match Octopus Energy conventions."
    severity: warn
    given: "$.paths.*~"
    then:
      function: pattern
      functionOptions:
        match: "/$"
  octopus-title-case-summaries:
    description: Operation summaries use Title Case.
    message: "{{property}} should be in Title Case."
    severity: warn
    given: "$.paths.*.*.summary"
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-z0-9]*(\\s|$))+"
  octopus-https-only-server:
    description: Server URLs must be HTTPS.
    message: "Server URL '{{value}}' must use https."
    severity: error
    given: "$.servers.*.url"
    then:
      function: pattern
      functionOptions:
        match: "^https://"
  octopus-basic-auth-security:
    description: Basic auth is the documented authentication scheme.
    severity: info
    given: "$.components.securitySchemes.basicAuth.scheme"
    then:
      function: pattern
      functionOptions:
        match: "^basic$"