Skip to content

Web endpoints: match the 422 body and document reason - #30

Merged
Pietrus-914 merged 1 commit into
mainfrom
docs/web-errors-and-reason
Nov 29, 2026
Merged

Pietrus-914 merged 1 commit into
mainfrom
docs/web-errors-and-reason

Conversation

@Pietrus-914

Copy link
Copy Markdown
Contributor

Fixes four mismatches between the Web Search / Web Contents docs and what the API returns. Each was checked against the live API.

Changes

  • 422 body. response_error_default described errors as an array and listed data and statusCode. The API sends errors as a map of field name to messages and no data or statusCode, which is what the Errors page already says. The schema now matches. content_rejected and concurrency_limited are added to the code values, since the web endpoints already name them in their descriptions.
  • reason. WebPage gains the optional reason field. The API sends "reason": "fetch_failed" with some unknown results, while the docs said unknown comes with no reason.
  • Unknown fields. Both pages now say that a top-level field the API does not know is ignored without an error (only_domain instead of only_domains returns 200 and unfiltered results).
  • include. An unknown key in include is refused with The include field must be an array. The search page explains what that message means.
  • 422 examples added to both endpoints, in the spec and on the pages.

openapi.json and openapi-v2.json are identical.

Not covered

  • openapi-v1.json still describes the old error shape.
  • The last two points document current behaviour. Rejecting unknown fields and a clearer include message need an API change.

- response_error_default: errors is a map of field -> messages, and the
  body carries no data or statusCode (as the Errors page already says)
- WebPage: add the optional reason field sent with some unknown results
- web/search, web/contents: add 422 examples, note that unknown top-level
  fields are ignored and what the include key error means
@Pietrus-914
Pietrus-914 merged commit 28fccf4 into main Nov 29, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant