Ship24 · API Governance Rules

Ship24 API Rules

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

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

Rule Categories

ship24

Rules

error
ship24-info-title
Info.title MUST mention Ship24.
$.info.title
error
ship24-info-description-required
Info.description MUST be non-empty for a tracking API.
$.info.description
error
ship24-server-base-url
At least one server URL MUST point to api.ship24.com.
$.servers[*].url
error
ship24-bearer-security
Bearer token security scheme MUST be declared.
$.components.securitySchemes
warn
ship24-operation-summary-title-case
Operation summaries SHOULD use Title Case.
$.paths.*[get,post,put,patch,delete].summary
error
ship24-operation-tags-required
Every operation MUST declare at least one tag.
$.paths.*[get,post,put,patch,delete]
error
ship24-operation-id-required
Every operation MUST declare an operationId.
$.paths.*[get,post,put,patch,delete]
warn
ship24-tracker-path-shape
Tracker paths SHOULD live under /public/v1/trackers.
$.paths[?(@property.match(/tracker/i))]~
info
ship24-rate-limit-documentation
Description SHOULD mention rate limits or link to docs.ship24.com/rate-limiter.
$.info.description

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  ship24-info-title:
    description: Info.title MUST mention Ship24.
    severity: error
    given: "$.info.title"
    then:
      function: pattern
      functionOptions:
        match: "Ship24"

  ship24-info-description-required:
    description: Info.description MUST be non-empty for a tracking API.
    severity: error
    given: "$.info.description"
    then:
      function: truthy

  ship24-server-base-url:
    description: At least one server URL MUST point to api.ship24.com.
    severity: error
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "api\\.ship24\\.com"

  ship24-bearer-security:
    description: Bearer token security scheme MUST be declared.
    severity: error
    given: "$.components.securitySchemes"
    then:
      function: truthy

  ship24-operation-summary-title-case:
    description: Operation summaries SHOULD use Title Case.
    severity: warn
    given: "$.paths.*[get,post,put,patch,delete].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z]"

  ship24-operation-tags-required:
    description: Every operation MUST declare at least one tag.
    severity: error
    given: "$.paths.*[get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  ship24-operation-id-required:
    description: Every operation MUST declare an operationId.
    severity: error
    given: "$.paths.*[get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  ship24-tracker-path-shape:
    description: Tracker paths SHOULD live under /public/v1/trackers.
    severity: warn
    given: "$.paths[?(@property.match(/tracker/i))]~"
    then:
      function: pattern
      functionOptions:
        match: "^/public/v1/trackers"

  ship24-rate-limit-documentation:
    description: Description SHOULD mention rate limits or link to docs.ship24.com/rate-limiter.
    severity: info
    given: "$.info.description"
    then:
      function: pattern
      functionOptions:
        match: "(rate|limit|throttl)"