Skip to content

Stop documenting the docs API cookie gate - #4898

Closed
akira28 wants to merge 1 commit into
feature/docs-api-in-api-explorerfrom
chore/docs-api-drop-cookie-gate
Closed

akira28 wants to merge 1 commit into
feature/docs-api-in-api-explorerfrom
chore/docs-api-drop-cookie-gate

Conversation

@akira28

@akira28 akira28 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

The docs API is no longer behind the feature_search_or_askai_enabled cookie, so its documentation stops asking for one.

Affects: API docs

Stack: fifth layer of #4895, on top of #4897.

Depends on: elastic/docs-infra#523, which sets production's api_authorization_mode to none. Merge this after it is applied. Until then, production still answers 403 to uncached requests without the cookie.

Prompt summary: The team agreed to remove the cookie that gates the docs API in production. Add a fifth PR to the stack that drops it on the docs-builder side.

Why

The CDN gate is set in elastic/docs-infra: production runs api_authorization_mode = "cookie", while edge, staging and demo already run none. docs-builder never sets or reads the cookie. Its only mentions are the ones #4896 added to describe the gate.

The gate was already leaky: the cache layer behind CloudFront serves a stored response without checking the cookie, so a popular query worked for everyone.

What

  • OpenAPI description: "Search, Ask AI, change feeds, feedback and the API reference behind elastic.co/docs." with no cookie note. OpenApiDocumentTests now checks that the description names no cookie.
  • docs/data/api.md: drops the cookie sentence. The example of a CDN error that isn't a problem is now "a 403 from its firewall".
  • docs/docs-api.json: regenerated, so the spec copy in API Explorer matches.

Verify

dotnet test --project tests/Elastic.Documentation.Api.Tests   # 291 pass
git grep -i feature_search_or_askai                             # no match

After the docs-infra change is applied:

curl -s -o /dev/null -w '%{http_code}\n' "https://www.elastic.co/docs/_api/v1/search?q=health%20$RANDOM&size=1"   # 200, no cookie

🤖 Generated with Claude Code

@akira28
akira28 added this pull request to stack #4895 November 17, 2026 15:51
@akira28 akira28 added the chore label Nov 17, 2026
@akira28 akira28 changed the title chore/docs api drop cookie gate Stop documenting the docs API cookie gate Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

The team is dropping the feature_search_or_askai_enabled cookie that the CDN required for the docs API in production (edge, staging and demo already run without it). The OpenAPI description, the REST API page and the spec copy no longer mention it, and a test keeps the description from naming one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@akira28
akira28 force-pushed the chore/docs-api-drop-cookie-gate branch 3 times, most recently from 771f3fb to 4eb61fe Compare November 18, 2026 11:43
akira28 added a commit that referenced this pull request Nov 18, 2026
elastic/docs-infra#523 drops production's cookie gate on the docs API, so the curl samples, the OpenAPI description and docs/data/api.md stop asking for feature_search_or_askai_enabled. Folds in #4898.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@akira28

akira28 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #4942, which merges from main.

@akira28 akira28 closed this Nov 18, 2026
akira28 added a commit that referenced this pull request Nov 18, 2026
…mples (#4942)

* Describe the docs API's OpenAPI document and add examples and code samples

Every operation, parameter, response, tag, schema and field has a
description, and every field and parameter an example. Each operation has
example requests with real responses, a curl sample per example, and the
Elastic CLI command where one is released. Response examples are trimmed
replies from the API, checked against the response types. The Ask AI stream
response now declares its text/event-stream content.

Field descriptions and examples come from doc comments, so the API, search and
search contract projects generate XML documentation. Microsoft.OpenApi moves
to 3.11.1, and the unused Microsoft.OpenApi.Readers pin is removed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(api): pair each docs API example with its own response and error type

- API Explorer keeps response-only examples apart when samples name them, sharing the unnamed error statuses as tabs instead of folding all into one example.
- Error examples show the problem type each operation really returns.
- curl samples send the cookie www.elastic.co's CDN still requires until elastic/docs-infra#523 is applied.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(api): stop documenting the docs API cookie gate

elastic/docs-infra#523 drops production's cookie gate on the docs API, so the curl samples, the OpenAPI description and docs/data/api.md stop asking for feature_search_or_askai_enabled. Folds in #4898.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant