Tripadvisor · API Governance Rules

Tripadvisor API Rules

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

9 Rules error 2 warn 7
View Rules File View on GitHub

Rule Categories

tripadvisor

Rules

warn
tripadvisor-path-versioned
Tripadvisor Content API paths must use /api/v1/ prefix
$.paths[*]~
warn
tripadvisor-operation-id-camel-case
OperationIds must use camelCase
$.paths[*][*].operationId
error
tripadvisor-summary-title-case
Operation summaries must use Title Case
$.paths[*][*].summary
error
tripadvisor-get-must-have-200
GET operations must define a 200 response
$.paths[*].get
warn
tripadvisor-must-have-400-response
All operations must document a 400 Bad Request response
$.paths[*][get,post,put,delete].responses
warn
tripadvisor-must-have-401-response
All operations must document 401 Unauthorized response
$.paths[*][get,post,put,delete].responses
warn
tripadvisor-operation-must-have-description
All operations must have a description
$.paths[*][get,post,put,patch,delete]
warn
tripadvisor-schema-pascal-case
Schema names must use PascalCase
$.components.schemas[*]~
warn
tripadvisor-operations-must-use-defined-tags
Operations should use tags defined in the top-level tags array
$.paths[*][*].tags[*]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  # Content API must use /api/v1/ prefix
  tripadvisor-path-versioned:
    description: Tripadvisor Content API paths must use /api/v1/ prefix
    message: "Path '{{property}}' should start with /api/v1/"
    given: "$.paths[*]~"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^/(api/v1|v[0-9]+)/"

  # All operations must have operationIds in camelCase
  tripadvisor-operation-id-camel-case:
    description: OperationIds must use camelCase
    message: "OperationId '{{value}}' should use camelCase"
    given: "$.paths[*][*].operationId"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]+$"

  # All operation summaries must use Title Case
  tripadvisor-summary-title-case:
    description: Operation summaries must use Title Case
    message: "Summary '{{value}}' should use Title Case"
    given: "$.paths[*][*].summary"
    severity: error
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9 ]+$"

  # All GET operations must have a 200 response
  tripadvisor-get-must-have-200:
    description: GET operations must define a 200 response
    message: "GET operation is missing a 200 response"
    given: "$.paths[*].get"
    severity: error
    then:
      field: responses.200
      function: truthy

  # All operations must have a 400 response for error handling
  tripadvisor-must-have-400-response:
    description: All operations must document a 400 Bad Request response
    message: "Operation is missing 400 response definition"
    given: "$.paths[*][get,post,put,delete].responses"
    severity: warn
    then:
      field: "400"
      function: truthy

  # All operations must have a 401 response for unauthorized
  tripadvisor-must-have-401-response:
    description: All operations must document 401 Unauthorized response
    message: "Operation is missing 401 response definition"
    given: "$.paths[*][get,post,put,delete].responses"
    severity: warn
    then:
      field: "401"
      function: truthy

  # All operations must have descriptions
  tripadvisor-operation-must-have-description:
    description: All operations must have a description
    message: "Operation at '{{path}}' is missing a description"
    given: "$.paths[*][get,post,put,patch,delete]"
    severity: warn
    then:
      field: description
      function: truthy

  # Schema component names must use PascalCase
  tripadvisor-schema-pascal-case:
    description: Schema names must use PascalCase
    message: "Schema '{{property}}' should use PascalCase"
    given: "$.components.schemas[*]~"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z][a-zA-Z0-9]+$"

  # Tags must be defined in the top-level tags list
  tripadvisor-operations-must-use-defined-tags:
    description: Operations should use tags defined in the top-level tags array
    message: "Tag '{{value}}' used in operation but not defined at top level"
    given: "$.paths[*][*].tags[*]"
    severity: warn
    then:
      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/tripadvisor-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.