Tomorrow.io · API Governance Rules

Tomorrow.io API Rules

Spectral linting rules defining API design standards and conventions for Tomorrow.io.

6 Rules error 2 warn 3 info 1
View Rules File View on GitHub

Rule Categories

tomorrow

Rules

error
tomorrow-io-base-url
All Tomorrow.io OpenAPI specs must declare https://api.tomorrow.io/v4 as a server.
$.servers
warn
tomorrow-io-apikey-query-auth
All operations must authenticate with the apikey query parameter (apikeyAuth securityScheme).
$.components.securitySchemes.apikeyAuth
warn
tomorrow-io-operation-summary
Every operation must have a Title Case summary.
$.paths.*[get,post,put,delete,patch]
error
tomorrow-io-operationid-required
Every operation must declare an operationId.
$.paths.*[get,post,put,delete,patch]
warn
tomorrow-io-tag-required
Every operation must declare at least one tag.
$.paths.*[get,post,put,delete,patch].tags
info
tomorrow-io-version-v4
The OpenAPI spec must declare API version 4.x.
$.info.version

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  tomorrow-io-base-url:
    description: All Tomorrow.io OpenAPI specs must declare https://api.tomorrow.io/v4 as a server.
    severity: error
    given: $.servers
    then:
      function: schema
      functionOptions:
        schema:
          type: array
          contains:
            type: object
            properties:
              url:
                const: https://api.tomorrow.io/v4
  tomorrow-io-apikey-query-auth:
    description: All operations must authenticate with the apikey query parameter (apikeyAuth securityScheme).
    severity: warn
    given: $.components.securitySchemes.apikeyAuth
    then:
      field: in
      function: enumeration
      functionOptions:
        values: [query]
  tomorrow-io-operation-summary:
    description: Every operation must have a Title Case summary.
    severity: warn
    given: $.paths.*[get,post,put,delete,patch]
    then:
      field: summary
      function: truthy
  tomorrow-io-operationid-required:
    description: Every operation must declare an operationId.
    severity: error
    given: $.paths.*[get,post,put,delete,patch]
    then:
      field: operationId
      function: truthy
  tomorrow-io-tag-required:
    description: Every operation must declare at least one tag.
    severity: warn
    given: $.paths.*[get,post,put,delete,patch].tags
    then:
      function: length
      functionOptions:
        min: 1
  tomorrow-io-version-v4:
    description: The OpenAPI spec must declare API version 4.x.
    severity: info
    given: $.info.version
    then:
      function: pattern
      functionOptions:
        match: '^4'