Tesla · API Governance Rules

Tesla API Rules

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

8 Rules error 1 warn 5 info 2
View Rules File View on GitHub

Rule Categories

tesla

Rules

error
tesla-operation-ids-present
All operations must have operationId defined
$.paths.*[get,post,put,patch,delete]
warn
tesla-operation-id-pascal-case
Operation IDs should use PascalCase
$.paths.*[get,post,put,patch,delete].operationId
info
tesla-summaries-start-with-provider
Tesla API summaries should start with the provider name "Tesla"
$.paths.*[get,post,put,patch,delete].summary
warn
tesla-tags-required
Each operation should have at least one tag
$.paths.*[get,post,put,patch,delete]
warn
tesla-bearer-auth
Tesla API uses OAuth2 bearer token authentication
$.components.securitySchemes.*
info
tesla-vehicle-id-path-param
Vehicle endpoints should use vehicle_id path parameter
$.paths./api/1/vehicles/*
warn
tesla-response-200
Operations should define a 200 response
$.paths.*[get,post]
warn
tesla-parameter-descriptions
Path parameters should have descriptions
$.paths..parameters[?(@.in == 'path')]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  tesla-operation-ids-present:
    description: All operations must have operationId defined
    message: "Operation at {{path}} is missing operationId"
    severity: error
    given: "$.paths.*[get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  tesla-operation-id-pascal-case:
    description: Operation IDs should use PascalCase
    message: "Operation ID '{{value}}' should use PascalCase"
    severity: warn
    given: "$.paths.*[get,post,put,patch,delete].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][A-Za-z0-9]+$"

  tesla-summaries-start-with-provider:
    description: Tesla API summaries should start with the provider name "Tesla"
    message: "Summary '{{value}}' should start with 'Tesla '"
    severity: info
    given: "$.paths.*[get,post,put,patch,delete].summary"
    then:
      function: pattern
      functionOptions:
        match: "^Tesla "

  tesla-tags-required:
    description: Each operation should have at least one tag
    message: "Operation at {{path}} should have at least one tag"
    severity: warn
    given: "$.paths.*[get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  tesla-bearer-auth:
    description: Tesla API uses OAuth2 bearer token authentication
    message: "Security should use bearer token"
    severity: warn
    given: "$.components.securitySchemes.*"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          anyOf:
            - properties:
                type:
                  const: http
                scheme:
                  const: bearer
            - properties:
                type:
                  const: oauth2

  tesla-vehicle-id-path-param:
    description: Vehicle endpoints should use vehicle_id path parameter
    message: "Vehicle path should use {vehicle_id} parameter"
    severity: info
    given: "$.paths./api/1/vehicles/*"
    then:
      function: truthy

  tesla-response-200:
    description: Operations should define a 200 response
    message: "Operation should define a 200 OK response"
    severity: warn
    given: "$.paths.*[get,post]"
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            responses:
              type: object
              required: ["200"]

  tesla-parameter-descriptions:
    description: Path parameters should have descriptions
    message: "Path parameter is missing a description"
    severity: warn
    given: "$.paths..parameters[?(@.in == 'path')]"
    then:
      field: description
      function: truthy

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/tesla-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.