Schema.org · API Governance Rules

Schema.org API Rules

Spectral linting rules defining API design standards and conventions for Schema.org.

10 Rules error 5 warn 5
View Rules File View on GitHub

Rule Categories

schema

Rules

error
schema-org-context-required
JSON-LD documents must include @context pointing to schema.org
$
error
schema-org-type-required
JSON-LD documents must include @type declaring the Schema.org type
$
warn
schema-org-name-recommended
Most Schema.org types should have a name property
$[?(@type)]
error
schema-org-url-format
URL properties must be valid URIs
$.url
warn
schema-org-same-as-format
sameAs references should be valid URIs
$.sameAs
warn
schema-org-aggregate-rating-values
AggregateRating must include ratingValue
$[?(@type == 'AggregateRating')]
error
schema-org-offer-price-currency
Offers must include both price and priceCurrency
$[?(@type == 'Offer')]
warn
schema-org-webapi-documentation
WebAPI types should include documentation URL
$[?(@type == 'WebAPI')]
warn
schema-org-organization-url
Organization entities should include a URL
$[?(@type == 'Organization')]
error
schema-org-person-name
Person entities must include a name
$[?(@type == 'Person')]

Spectral Ruleset

schema-org-rules.yml Raw ↑
rules:
  schema-org-context-required:
    description: JSON-LD documents must include @context pointing to schema.org
    message: "JSON-LD structured data must include @context with schema.org or https://schema.org"
    severity: error
    given: "$"
    then:
      field: "@context"
      function: truthy

  schema-org-type-required:
    description: JSON-LD documents must include @type declaring the Schema.org type
    message: "JSON-LD structured data must include @type"
    severity: error
    given: "$"
    then:
      field: "@type"
      function: truthy

  schema-org-name-recommended:
    description: Most Schema.org types should have a name property
    message: "Schema.org entities should have a name property for human-readable identification"
    severity: warn
    given: "$[?(@type)]"
    then:
      field: name
      function: truthy

  schema-org-url-format:
    description: URL properties must be valid URIs
    message: "Schema.org url properties must be valid URIs"
    severity: error
    given: "$.url"
    then:
      function: pattern
      functionOptions:
        match: "^https?://"

  schema-org-same-as-format:
    description: sameAs references should be valid URIs
    message: "sameAs links should be valid URIs pointing to authoritative references"
    severity: warn
    given: "$.sameAs"
    then:
      function: pattern
      functionOptions:
        match: "^https?://"

  schema-org-aggregate-rating-values:
    description: AggregateRating must include ratingValue
    message: "AggregateRating should include ratingValue, ratingCount, and bestRating"
    severity: warn
    given: "$[?(@type == 'AggregateRating')]"
    then:
      field: ratingValue
      function: truthy

  schema-org-offer-price-currency:
    description: Offers must include both price and priceCurrency
    message: "Offer objects must include both price and priceCurrency properties"
    severity: error
    given: "$[?(@type == 'Offer')]"
    then:
      field: priceCurrency
      function: truthy

  schema-org-webapi-documentation:
    description: WebAPI types should include documentation URL
    message: "WebAPI structured data should include a documentation URL"
    severity: warn
    given: "$[?(@type == 'WebAPI')]"
    then:
      field: documentation
      function: truthy

  schema-org-organization-url:
    description: Organization entities should include a URL
    message: "Organization type should include a url property"
    severity: warn
    given: "$[?(@type == 'Organization')]"
    then:
      field: url
      function: truthy

  schema-org-person-name:
    description: Person entities must include a name
    message: "Person type must include a name property"
    severity: error
    given: "$[?(@type == 'Person')]"
    then:
      field: name
      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/schema-org-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.