Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
39 changes: 39 additions & 0 deletions site/content/3.12/develop/http-api/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,45 @@ logJsonResponse(response);
db._drop(cn);
```

### Get the available key generators

```openapi
paths:
/_api/key-generators:
get:
operationId: getKeyGenerators
description: |
Returns the available key generators for collections.

The call returns a JSON object with the available key generators
on success:

- `padded`
- `uuid`
- `autoincrement`
- `traditional`
responses:
'200':
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine in Swagger UI and swagger-cli validated it as correct, so it looks like the toolchain is not able to render a construct like this

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With added example value:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

description: |
The key generators that were found.
tags:
- Collections
```

**Examples:**

```curl
---
description: |-
Retrieving the key generators of collections:
name: RestCollectionGetKeyGenerators
---
var url = "/_api/key-generators/"
var response = logCurlRequest('GET', url);
assert(response.code === 200);
logJsonResponse(response);
```

## Create and delete collections

### Create a collection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,15 @@ The default value remains 128 MiB.

### Endpoints added

#### Collections API

You can now retrieve the key generators for collections using the following
endpoint:

`GET /_api/key-generators`

See the [description](../../develop/http-api/collections.md#get-the-available-key-generators)
for details.

### Endpoints augmented

Expand Down