Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/data/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ navigation_title: REST API

{{dbuild}} includes a REST API server (`Elastic.Documentation.Api`) that powers search, AI assistance, and content change feeds for the documentation site.

The server describes itself in an OpenAPI document at `/docs/_api/v1/openapi.json`, generated from its endpoints. It lists every endpoint with its parameters, request bodies, responses, and error codes. Requests through `www.elastic.co` need the cookie `feature_search_or_askai_enabled=true`; without it, the CDN answers `403`.
The server describes itself in an OpenAPI document at `/docs/_api/v1/openapi.json`, generated from its endpoints. It lists every endpoint with its parameters, request bodies, responses, and error codes.

## Endpoints

Expand Down Expand Up @@ -88,7 +88,7 @@ Every error is an [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem, se
- `detail` explains this occurrence, for people.
- `traceId` names the request's trace. Quote it when you report a problem.

Errors from the CDN, such as the `403` for a missing cookie, aren't problems and aren't JSON.
Errors from the CDN, such as a `403` from its firewall, aren't problems and aren't JSON.

### Invalid arguments [invalid-arguments]

Expand Down
2 changes: 1 addition & 1 deletion docs/docs-api.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"openapi": "3.2.0",
"info": {
"title": "Elastic Docs API",
"description": "Search, Ask AI, change feeds, feedback and the API reference behind elastic.co/docs. Requests through www.elastic.co need the cookie feature_search_or_askai_enabled=true; without it the CDN answers 403.",
"description": "Search, Ask AI, change feeds, feedback and the API reference behind elastic.co/docs.",
"version": "v1"
},
"servers": [
Expand Down
3 changes: 1 addition & 2 deletions src/api/Elastic.Documentation.Api/ServicesExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@ private static void AddElasticDocsApiServices(this IServiceCollection services,
{
Title = "Elastic Docs API",
Version = "v1",
Description = "Search, Ask AI, change feeds, feedback and the API reference behind elastic.co/docs. "
+ "Requests through www.elastic.co need the cookie feature_search_or_askai_enabled=true; without it the CDN answers 403."
Description = "Search, Ask AI, change feeds, feedback and the API reference behind elastic.co/docs."
};
document.Servers = [new OpenApiServer { Url = "https://www.elastic.co" }];
return Task.CompletedTask;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,8 @@ public async Task Document_NamesTheApiAndThePublicServer()
var document = await Document();

document.GetProperty("info").GetProperty("title").GetString().Should().Be("Elastic Docs API");
document.GetProperty("info").GetProperty("description").GetString().Should().Contain("feature_search_or_askai_enabled=true");
// The CDN no longer gates the API behind a cookie, so the description names none.
document.GetProperty("info").GetProperty("description").GetString().Should().NotContainEquivalentOf("cookie");
document.GetProperty("servers")[0].GetProperty("url").GetString().Should().Be("https://www.elastic.co");
}
}
Loading