UPS · API Governance Rules

UPS API Rules

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

6 Rules warn 3 info 3
View Rules File View on GitHub

Rule Categories

ups

Rules

warn
ups-operation-ids-camel-case
Operation IDs must use camelCase
$.paths[*][*].operationId
warn
ups-summaries-title-case
Operation summaries must use Title Case
$.paths[*][*].summary
warn
ups-bearer-auth-required
All non-OAuth operations must use BearerAuth
$.paths[?(!@property.match(/\/oauth\/token/))][get,post,delete]
info
ups-request-wrappers
UPS API requests use PascalCase wrapper objects
$.paths[*][post,put].requestBody.content.application/json.schema
info
ups-void-uses-delete
Void/cancel operations should use DELETE method
$.paths[?(@property.match(/void|cancel/))]
info
ups-tracking-number-path-param
Tracking endpoints use path parameters for tracking numbers
$.paths[?(@property.match(/track/))]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  ups-operation-ids-camel-case:
    description: Operation IDs must use camelCase
    message: "Operation ID '{{value}}' must be camelCase"
    severity: warn
    given: "$.paths[*][*].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  ups-summaries-title-case:
    description: Operation summaries must use Title Case
    message: "Summary '{{value}}' must use Title Case"
    severity: warn
    given: "$.paths[*][*].summary"
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-z0-9]* ?)+$"

  ups-bearer-auth-required:
    description: All non-OAuth operations must use BearerAuth
    message: "Operation must specify BearerAuth security"
    severity: warn
    given: "$.paths[?(!@property.match(/\\/oauth\\/token/))][get,post,delete]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

  ups-request-wrappers:
    description: UPS API requests use PascalCase wrapper objects
    message: "UPS request bodies typically use PascalCase wrapper properties"
    severity: info
    given: "$.paths[*][post,put].requestBody.content.application/json.schema"
    then:
      function: schema
      functionOptions:
        schema:
          type: object

  ups-void-uses-delete:
    description: Void/cancel operations should use DELETE method
    message: "Void/cancel operations should use DELETE HTTP method"
    severity: info
    given: "$.paths[?(@property.match(/void|cancel/))]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          required: [delete]

  ups-tracking-number-path-param:
    description: Tracking endpoints use path parameters for tracking numbers
    message: "Tracking endpoint should use path parameter for inquiry/tracking number"
    severity: info
    given: "$.paths[?(@property.match(/track/))]"
    then:
      function: pattern
      functionOptions:
        match: ".*\\{.*\\}.*"

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/ups-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

A second provider on the same verified email joins the account you already have.