-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
1,073 additions
and
494 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
AppId: | ||
name: X-Algolia-Application-Id | ||
in: header | ||
description: Algolia appID | ||
required: true | ||
schema: | ||
type: string | ||
pattern: "^(?:beta|testing)?[A-Z0-9]{10}$" | ||
example: "DJNVGS47DK" | ||
ApiKey: | ||
name: X-Algolia-API-Key | ||
in: header | ||
description: Algolia API key | ||
required: true | ||
schema: | ||
type: string | ||
pattern: "^[a-f0-9]{32}$" | ||
example: "43b15df305339e827f0ac0bdc5ebcaa7" | ||
IndexName: | ||
name: indexName | ||
in: path | ||
description: The index in which to perform the request | ||
required: true | ||
schema: | ||
type: string | ||
example: "myIndexName" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
post: | ||
tags: | ||
- object | ||
operationId: batch | ||
summary: Performs multiple write operations in a single API call | ||
parameters: | ||
- $ref: "../../parameters.yml#/AppId" | ||
- $ref: "../../parameters.yml#/ApiKey" | ||
- $ref: "../../parameters.yml#/IndexName" | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
title: operation | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
action: | ||
type: string | ||
enum: | ||
- "addObject" | ||
- "updateObject" | ||
- "partialUpdateObject" | ||
- "partialUpdateObjectNoCreate" | ||
- "deleteObject" | ||
- "delete" | ||
- "clear" | ||
description: type of operation | ||
body: | ||
type: object | ||
# this could be a long oneOf with every possibilities | ||
additionalProperties: true | ||
description: arguments to the operation (depends on the type of the operation) | ||
responses: | ||
"200": | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
taskID: | ||
type: integer | ||
objectIDs: | ||
type: array | ||
items: | ||
type: string | ||
"400": | ||
$ref: "../../responses/BadRequest.yml" | ||
"404": | ||
$ref: "../../responses/IndexNotFound.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
post: | ||
tags: | ||
- object | ||
operationId: saveObject | ||
summary: Save object | ||
description: Add an object to the index, automatically assigning it an object ID | ||
parameters: | ||
- $ref: "../../parameters.yml#/AppId" | ||
- $ref: "../../parameters.yml#/ApiKey" | ||
- $ref: "../../parameters.yml#/IndexName" | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
additionalProperties: true | ||
responses: | ||
"200": | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
taskID: | ||
type: number | ||
objectID: | ||
type: string | ||
"400": | ||
$ref: "../../responses/BadRequest.yml" | ||
"404": | ||
$ref: "../../responses/IndexNotFound.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
post: | ||
tags: | ||
- search | ||
operationId: search | ||
summary: Get search results | ||
parameters: | ||
- $ref: "../../parameters.yml#/AppId" | ||
- $ref: "../../parameters.yml#/ApiKey" | ||
- $ref: "../../parameters.yml#/IndexName" | ||
requestBody: | ||
$ref: "../../schemas/SearchParams.yml" | ||
responses: | ||
"200": | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
title: singleQueryResponse | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
hits: | ||
type: array | ||
items: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
objectID: | ||
type: string | ||
example: objectID1 | ||
nbHits: | ||
type: integer | ||
queryID: | ||
type: string | ||
pattern: "[a-f0-9]{32}" | ||
example: 43b15df305339e827f0ac0bdc5ebcaa7 | ||
"400": | ||
$ref: "../../responses/BadRequest.yml" | ||
"404": | ||
$ref: "../../responses/IndexNotFound.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
post: | ||
tags: | ||
- search | ||
operationId: searchMulti | ||
summary: Get search results for the given requests. | ||
parameters: | ||
- $ref: "../../parameters.yml#/AppId" | ||
- $ref: "../../parameters.yml#/ApiKey" | ||
requestBody: | ||
required: true | ||
content: | ||
application/json: | ||
schema: | ||
type: array | ||
items: | ||
title: multipleQueries | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
indexName: | ||
type: string | ||
example: products | ||
description: The Algolia index name | ||
query: | ||
type: string | ||
description: The query to search for | ||
type: | ||
type: string | ||
enum: [default, facet] | ||
default: default | ||
description: Perform a search query with `default`, will search for facet values if `facet` is given | ||
facet: | ||
type: string | ||
description: The `facet` name | ||
params: | ||
type: object | ||
additionalProperties: true | ||
description: A key-value mapping of additional search parameters | ||
example: | ||
filters: "in_stock:true" | ||
required: | ||
- indexName | ||
responses: | ||
"200": | ||
description: OK | ||
content: | ||
application/json: | ||
schema: | ||
title: multipleQueriesResponse | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
results: | ||
type: array | ||
items: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
hits: | ||
type: array | ||
items: | ||
type: object | ||
additionalProperties: false | ||
properties: | ||
objectID: | ||
type: string | ||
example: objectID1 | ||
nbHits: | ||
type: integer | ||
queryID: | ||
type: string | ||
pattern: "[a-f0-9]{32}" | ||
example: 43b15df305339e827f0ac0bdc5ebcaa7 | ||
"400": | ||
$ref: "../../responses/BadRequest.yml" | ||
"404": | ||
$ref: "../../responses/IndexNotFound.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
description: Bad request or request arguments | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../schemas/Error.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
description: Index not found | ||
content: | ||
application/json: | ||
schema: | ||
$ref: "../schemas/Error.yml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
description: Error | ||
type: object | ||
additionalProperties: true | ||
properties: | ||
message: | ||
type: string | ||
example: "Invalid application id" |
Oops, something went wrong.