Deno · API Governance Rules

Deno API Rules

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

5 Rules error 2 warn 3
View Rules File View on GitHub

Rule Categories

deno

Rules

warn
deno-info-contact-email
Info object should contain Deno Deploy support contact details.
$.info.contact
error
deno-server-https
Servers should be HTTPS only for Deno Deploy APIs.
$.servers[*].url
error
deno-bearer-auth-required
Deno Deploy APIs use Bearer token authentication.
$.components.securitySchemes
warn
deno-tag-allowed
Tags should match the documented Deno Deploy resource categories.
$.tags[*].name
warn
deno-operation-id-camel
Operation IDs should be camelCase.
$.paths.*[get,post,put,patch,delete].operationId

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  deno-info-contact-email:
    description: Info object should contain Deno Deploy support contact details.
    given: $.info.contact
    severity: warn
    then:
      field: name
      function: truthy
  deno-server-https:
    description: Servers should be HTTPS only for Deno Deploy APIs.
    given: $.servers[*].url
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "^https://"
  deno-bearer-auth-required:
    description: Deno Deploy APIs use Bearer token authentication.
    given: $.components.securitySchemes
    severity: error
    then:
      field: bearerAuth
      function: truthy
  deno-tag-allowed:
    description: Tags should match the documented Deno Deploy resource categories.
    given: $.tags[*].name
    severity: warn
    then:
      function: enumeration
      functionOptions:
        values:
          - Deployments
          - Domains
          - KV Databases
          - Organizations
          - Projects
          - Apps
          - Revisions
          - Layers
          - Analytics
          - Subhosting
  deno-operation-id-camel:
    description: Operation IDs should be camelCase.
    given: $.paths.*[get,post,put,patch,delete].operationId
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]+$"