Onfleet · API Governance Rules

Onfleet API Rules

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

8 Rules error 3 warn 5
Authorship not recorded No authorship marker is recorded for this file. It is not presented as the provider's; it was most likely written by an API Evangelist pass before outputs were stamped.
View Rules File View on GitHub

Rule Categories

geojson no operation resource security servers unix

Rules

warn
operation-summary-title-case
Operation summaries must use Title Case.
$.paths[*][get,post,put,delete,patch].summary
warn
operation-id-camel-case
operationId must be camelCase.
$.paths[*][get,post,put,delete,patch].operationId
error
servers-base-path-v2
Onfleet base URL must use /api/v2 path.
$.servers[*].url
error
security-basic-auth-required
Onfleet APIs must declare basic auth as the default security scheme.
$
warn
geojson-coordinates-array
Geographic coordinates must be modelled as GeoJSON [longitude, latitude].
$..properties[?(@property === 'location')]
warn
unix-millisecond-timestamps
Timestamps must be int64 unix milliseconds.
$..properties[?(@property.match(/^(time|timeCreated|timeLastModified|completeAfter|completeBefore|startTime|endTime|eta)$/))]
warn
resource-id-string
Resource id fields must be string.
$..properties.id
error
no-trailing-slash
Path templates must not end with a trailing slash.
$.paths

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
rules:
  operation-summary-title-case:
    description: Operation summaries must use Title Case.
    severity: warn
    given: "$.paths[*][get,post,put,delete,patch].summary"
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-z0-9'-]*)(\\s+([A-Z][a-z0-9'-]*|[A-Z]+|By|To|In|On|For|And|Or|The|Of|A|An))*$"
  operation-id-camel-case:
    description: operationId must be camelCase.
    severity: warn
    given: "$.paths[*][get,post,put,delete,patch].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"
  servers-base-path-v2:
    description: Onfleet base URL must use /api/v2 path.
    severity: error
    given: "$.servers[*].url"
    then:
      function: pattern
      functionOptions:
        match: "^https://onfleet\\.com/api/v2$"
  security-basic-auth-required:
    description: Onfleet APIs must declare basic auth as the default security scheme.
    severity: error
    given: "$"
    then:
      field: "components.securitySchemes.basicAuth"
      function: truthy
  geojson-coordinates-array:
    description: Geographic coordinates must be modelled as GeoJSON [longitude, latitude].
    severity: warn
    given: "$..properties[?(@property === 'location')]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            type:
              const: array
            minItems:
              const: 2
            maxItems:
              const: 2
  unix-millisecond-timestamps:
    description: Timestamps must be int64 unix milliseconds.
    severity: warn
    given: "$..properties[?(@property.match(/^(time|timeCreated|timeLastModified|completeAfter|completeBefore|startTime|endTime|eta)$/))]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            type:
              enum: [integer]
            format:
              const: int64
  resource-id-string:
    description: Resource id fields must be string.
    severity: warn
    given: "$..properties.id"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            type:
              const: string
  no-trailing-slash:
    description: Path templates must not end with a trailing slash.
    severity: error
    given: "$.paths"
    then:
      function: pattern
      functionOptions:
        notMatch: ".+/$"

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/onfleet-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 form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

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