USPTO Trademark Search API · API Governance Rules

USPTO Trademark Search API API Rules

Spectral linting rules defining API design standards and conventions for USPTO Trademark Search API.

19 Rules error 8 warn 10 info 1
View Rules File View on GitHub

Rule Categories

uspto

Rules

error
uspto-trademark-path-versioned
$.paths[*]~
warn
uspto-trademark-path-kebab-case
$.paths[*]~
error
uspto-trademark-operation-id-required
$.paths[*][get,post,put,patch,delete]
warn
uspto-trademark-operation-id-camel-case
$.paths[*][get,post,put,patch,delete].operationId
warn
uspto-trademark-summary-title-case
$.paths[*][get,post,put,patch,delete].summary
error
uspto-trademark-summary-required
$.paths[*][get,post,put,patch,delete]
warn
uspto-trademark-description-required
$.paths[*][get,post,put,patch,delete]
warn
uspto-trademark-tags-required
$.paths[*][get,post,put,patch,delete]
error
uspto-trademark-response-200-required
$.paths[*].get
warn
uspto-trademark-response-401-required
$.paths[*][get,post,put,patch,delete]
warn
uspto-trademark-parameter-description
$.paths[*][get,post,put,patch,delete].parameters[*]
error
uspto-trademark-parameter-schema-required
$.paths[*][get,post,put,patch,delete].parameters[*]
info
uspto-trademark-schema-description
$.components.schemas[*].properties[*]
warn
uspto-trademark-serial-number-pattern
$.components.schemas[*].properties.serialNumber
error
uspto-trademark-security-defined
$.components.securitySchemes
warn
uspto-trademark-global-security
$
warn
uspto-trademark-info-contact
$.info
error
uspto-trademark-info-version
$.info
error
uspto-trademark-server-defined
$

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  # ── Path conventions ──────────────────────────────────────────────────────────

  uspto-trademark-path-versioned:
    message: "All paths must begin with a version prefix such as /v1/"
    severity: error
    given: "$.paths[*]~"
    then:
      function: pattern
      functionOptions:
        match: "^/v[0-9]/"

  uspto-trademark-path-kebab-case:
    message: "Path segments must use kebab-case (lowercase letters, digits, hyphens, or {variables})"
    severity: warn
    given: "$.paths[*]~"
    then:
      function: pattern
      functionOptions:
        match: "^(/v[0-9])?(/[a-z0-9-{}]+)+$"

  # ── Operation conventions ─────────────────────────────────────────────────────

  uspto-trademark-operation-id-required:
    message: "Every operation must have an operationId"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  uspto-trademark-operation-id-camel-case:
    message: "operationId must use camelCase"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].operationId"
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  uspto-trademark-summary-title-case:
    message: "Operation summary must use Title Case"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].summary"
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z]"

  uspto-trademark-summary-required:
    message: "Every operation must have a summary"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: summary
      function: truthy

  uspto-trademark-description-required:
    message: "Every operation should have a description"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: description
      function: truthy

  uspto-trademark-tags-required:
    message: "Every operation must have at least one tag"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: tags
      function: truthy

  # ── Response conventions ──────────────────────────────────────────────────────

  uspto-trademark-response-200-required:
    message: "Every GET operation must define a 200 response"
    severity: error
    given: "$.paths[*].get"
    then:
      field: responses.200
      function: truthy

  uspto-trademark-response-401-required:
    message: "Secured operations should document a 401 Unauthorized response"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: responses.401
      function: truthy

  # ── Parameter conventions ─────────────────────────────────────────────────────

  uspto-trademark-parameter-description:
    message: "All parameters should have a description"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].parameters[*]"
    then:
      field: description
      function: truthy

  uspto-trademark-parameter-schema-required:
    message: "All parameters must define a schema"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete].parameters[*]"
    then:
      field: schema
      function: truthy

  # ── Schema conventions ────────────────────────────────────────────────────────

  uspto-trademark-schema-description:
    message: "Schema properties should have descriptions"
    severity: info
    given: "$.components.schemas[*].properties[*]"
    then:
      field: description
      function: truthy

  uspto-trademark-serial-number-pattern:
    message: "Serial number parameters must enforce the 8-digit pattern"
    severity: warn
    given: "$.components.schemas[*].properties.serialNumber"
    then:
      field: type
      function: enumeration
      functionOptions:
        values: ["string"]

  # ── Security conventions ──────────────────────────────────────────────────────

  uspto-trademark-security-defined:
    message: "API must define security schemes"
    severity: error
    given: "$.components.securitySchemes"
    then:
      function: truthy

  uspto-trademark-global-security:
    message: "API should define global security requirements"
    severity: warn
    given: "$"
    then:
      field: security
      function: truthy

  # ── Info conventions ──────────────────────────────────────────────────────────

  uspto-trademark-info-contact:
    message: "API info must include contact information"
    severity: warn
    given: "$.info"
    then:
      field: contact
      function: truthy

  uspto-trademark-info-version:
    message: "API info must include a version"
    severity: error
    given: "$.info"
    then:
      field: version
      function: truthy

  uspto-trademark-server-defined:
    message: "API must define at least one server"
    severity: error
    given: "$"
    then:
      field: servers
      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/uspto-trademark-search-api-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.