Open Food Facts · API Governance Rules

Open Food Facts — robotoff rules

Spectral linting rules defining API design standards and conventions for Open Food Facts.

6 Rules error 3 warn 3
Published by Open Food Facts Served by the provider at https://github.com/openfoodfacts/robotoff/blob/4019f07251fb12191c445c852009cd8135b848de/.spectral.yml; the copy below was fetched from there.
View Rules File View on GitHub

Rule Categories

no operation parameter response schema server

Rules

warn
operation-summary-formatted
Operation summary should be properly formatted
$.paths[*][*]
warn
parameter-description
Parameters should have descriptions
$.paths[*][*].parameters[*]
error
response-success-status
Operations should have at least one success response (2xx)
$.paths[*][*].responses
warn
schema-properties-descriptions
Schema properties should have descriptions
$.components.schemas[*].properties[*]
error
no-empty-servers
Server array should not be empty
$.servers
error
server-url-format
Server URLs should be valid URLs
$.servers[*].url

Spectral Ruleset

Raw ↑
# harvested from https://github.com/openfoodfacts/robotoff/blob/4019f07251fb12191c445c852009cd8135b848de/.spectral.yml on 2026-10-09 — a Spectral ruleset published in the provider's own GitHub repository (openfoodfacts/robotoff); found by GitHub code search, fetched verbatim
x-method: harvested
x-stamped: 2026-10-09
x-source-url: https://github.com/openfoodfacts/robotoff/blob/4019f07251fb12191c445c852009cd8135b848de/.spectral.yml
extends: ["spectral:oas"]
rules:
  # Core OpenAPI rules
  openapi-tags: true
  operation-description: true
  operation-operationId: true
  operation-operationId-unique: true
  operation-parameters: true
  operation-tag-defined: true
  path-params: true
  contact-properties: false
  info-description: true
  info-contact: warn
  license-url: false
  
  # Custom rules for better API documentation
  operation-summary-formatted:
    description: "Operation summary should be properly formatted"
    message: "{{description}}: {{error}}"
    given: "$.paths[*][*]"
    then:
      field: "summary"
      function: "truthy"
    severity: warn
    
  parameter-description:
    description: "Parameters should have descriptions"
    message: "Parameter {{path}} should have a description"
    given: "$.paths[*][*].parameters[*]"
    then:
      field: "description"
      function: "truthy"
    severity: warn
    
  response-success-status:
    description: "Operations should have at least one success response (2xx)"
    message: "Operation should have at least one 2xx response"
    given: "$.paths[*][*].responses"
    then:
      function: "pattern"
      functionOptions:
        match: "^2[0-9][0-9]$"
    severity: error
    
  schema-properties-descriptions:
    description: "Schema properties should have descriptions"
    message: "Schema property should have a description"
    given: "$.components.schemas[*].properties[*]"
    then:
      field: "description"
      function: "truthy"
    severity: warn
    
  no-empty-servers:
    description: "Server array should not be empty"
    message: "Server array should not be empty"
    given: "$.servers"
    then:
      function: "length"
      functionOptions:
        min: 1
    severity: error
    
  server-url-format:
    description: "Server URLs should be valid URLs"
    message: "Server URL should be a valid URL"
    given: "$.servers[*].url"
    then:
      function: "pattern"
      functionOptions:
        match: "^https?://"
    severity: error

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/open-food-facts-robotoff-spectral-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.