Skip to content

Commit 5e18968

Browse files
authored
chore(specs): update composition specs for the doc website (#4450)
1 parent 944e8b9 commit 5e18968

File tree

2 files changed

+86
-9
lines changed

2 files changed

+86
-9
lines changed

specs/composition-full/paths/search/search.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
post:
22
tags:
3-
- Search
3+
- search
44
operationId: search
55
x-use-read-transporter: true
66
x-cacheable: true

specs/composition/spec.yml

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,81 @@
11
openapi: 3.0.2
22
info:
3-
title: Composition API
4-
description: Composition API.
3+
title: Composition API (beta)
4+
description: |
5+
The Algolia Composition API lets you run search requests on your Compositions.
6+
7+
## Client libraries
8+
9+
Use Algolia's API clients and libraries to reliably integrate Algolia's APIs with your apps.
10+
The official API clients are covered by Algolia's [Service Level Agreement](https://www.algolia.com/policies/sla/).
11+
12+
See: [Algolia's ecosystem](https://www.algolia.com/doc/guides/getting-started/how-algolia-works/in-depth/ecosystem/)
13+
14+
## Base URLs
15+
16+
The base URLs for requests to the Composition API are:
17+
18+
- `https://{APPLICATION_ID}.algolia.net`
19+
- `https://{APPLICATION_ID}-dsn.algolia.net`.
20+
If your subscription includes a [Distributed Search Network](https://dashboard.algolia.com/infra),
21+
this ensures that requests are sent to servers closest to users.
22+
23+
Both URLs provide high availability by distributing requests with load balancing.
24+
25+
**All requests must use HTTPS.**
26+
27+
## Retry strategy
28+
29+
To guarantee high availability, implement a retry strategy for all API requests using the URLs of your servers as fallbacks:
30+
31+
- `https://{APPLICATION_ID}-1.algolianet.com`
32+
- `https://{APPLICATION_ID}-2.algolianet.com`
33+
- `https://{APPLICATION_ID}-3.algolianet.com`
34+
35+
These URLs use a different DNS provider than the primary URLs.
36+
You should randomize this list to ensure an even load across the three servers.
37+
38+
All Algolia API clients implement this retry strategy.
39+
40+
## Authentication
41+
42+
To authenticate your API requests, add these headers:
43+
44+
- `x-algolia-application-id`. Your Algolia application ID.
45+
- `x-algolia-api-key`. An API key with the necessary permissions to make the request.
46+
The required access control list (ACL) to make a request is listed in each endpoint's reference.
47+
48+
You can find your application ID and API key in the [Algolia dashboard](https://dashboard.algolia.com/account).
49+
50+
## Request format
51+
52+
Depending on the endpoint, request bodies are either JSON objects or arrays of JSON objects,
53+
54+
## Parameters
55+
56+
Parameters are passed as query parameters for GET and DELETE requests,
57+
and in the request body for POST and PUT requests.
58+
59+
Query parameters must be [URL-encoded](https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding).
60+
Non-ASCII characters must be UTF-8 encoded.
61+
Plus characters (`+`) are interpreted as spaces.
62+
Arrays as query parameters must be one of:
63+
64+
- A comma-separated string: `attributesToRetrieve=title,description`
65+
- A URL-encoded JSON array: `attributesToRetrieve=%5B%22title%22,%22description%22%D`
66+
67+
## Response status and errors
68+
69+
The Composition API returns JSON responses.
70+
Since JSON doesn't guarantee any specific ordering, don't rely on the order of attributes in the API response.
71+
72+
Successful responses return a `2xx` status. Client errors return a `4xx` status. Server errors are indicated by a `5xx` status.
73+
Error responses have a `message` property with more information.
74+
75+
## Version
76+
77+
The current version of the Composition API is version 1, as indicated by the `/1/` in each endpoint's URL.
78+
579
version: 1.0.0
680
components:
781
securitySchemes:
@@ -34,18 +108,21 @@ security:
34108
- appId: []
35109
apiKey: []
36110
tags:
37-
- name: Compositions
111+
- name: compositions
112+
x-displayName: Compositions
38113
description: |
39114
Manage your compositions and composition settings.
40-
- name: Rules
115+
- name: rules
116+
x-displayName: Rules
41117
description: |
42118
Manage your compositions rules.
43-
- name: Search
44-
description: Search one or more indices for matching records or facet values.
119+
- name: search
120+
x-displayName: Search
121+
description: Search one composition for matching records or facet values.
45122
x-tagGroups:
46-
- name: Search
123+
- name: Compositions
47124
tags:
48-
- Compositions
125+
- search
49126
paths:
50127
# ########################
51128
# ### Search Endpoints ###

0 commit comments

Comments
 (0)