Mux · API Governance Rules

Mux API Rules

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

9 Rules warn 9
View Rules File View on GitHub

Rule Categories

mux

Rules

warn
mux-info-contact
API info should include the Mux DevEx contact.
$.info
warn
mux-info-title
API info title must include "Mux".
$.info.title
warn
mux-server-api
At least one server must reference api.mux.com.
$.servers[*].url
warn
mux-video-assets-resource
Mux Video API should expose /video/v1/assets.
$.paths
warn
mux-live-streams-resource
Mux Live Streaming should expose /video/v1/live-streams.
$.paths
warn
mux-data-views-resource
Mux Data API should expose /data/v1/video-views.
$.paths
warn
mux-operation-summary-title-case
All operations should have a Title Case summary.
$.paths[*][*].summary
warn
mux-operation-tags-required
Every operation must declare at least one tag aligning to a Mux product area.
$.paths[*][get,post,put,patch,delete]
warn
mux-security-basic-or-bearer
Mux uses HTTP Basic with Access Token credentials or JWTs; security schemes should be defined.
$.components.securitySchemes

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  mux-info-contact:
    description: API info should include the Mux DevEx contact.
    given: $.info
    severity: warn
    then:
      field: contact
      function: truthy
  mux-info-title:
    description: API info title must include "Mux".
    given: $.info.title
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "Mux"
  mux-server-api:
    description: At least one server must reference api.mux.com.
    given: $.servers[*].url
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "api\\.mux\\.com|stream\\.mux\\.com|image\\.mux\\.com|stats\\.mux\\.com"
  mux-video-assets-resource:
    description: Mux Video API should expose /video/v1/assets.
    given: $.paths
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "/video/v1/assets"
  mux-live-streams-resource:
    description: Mux Live Streaming should expose /video/v1/live-streams.
    given: $.paths
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "/video/v1/live-streams"
  mux-data-views-resource:
    description: Mux Data API should expose /data/v1/video-views.
    given: $.paths
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "/data/v1/video-views"
  mux-operation-summary-title-case:
    description: All operations should have a Title Case summary.
    given: $.paths[*][*].summary
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z]"
  mux-operation-tags-required:
    description: Every operation must declare at least one tag aligning to a Mux product area.
    given: $.paths[*][get,post,put,patch,delete]
    severity: warn
    then:
      field: tags
      function: truthy
  mux-security-basic-or-bearer:
    description: Mux uses HTTP Basic with Access Token credentials or JWTs; security schemes should be defined.
    given: $.components.securitySchemes
    severity: warn
    then:
      function: truthy