From fc38486701f72930152d7aa828ebfc480f8ae590 Mon Sep 17 00:00:00 2001 From: jozefcipa Date: Thu, 7 Jan 2021 17:09:15 +0100 Subject: [PATCH 1/3] Add docs for configurable limit --- .gitignore | 4 ++++ developer-docs/latest/concepts/configurations.md | 3 +++ 2 files changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index 4cedecc917..f60df091be 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,7 @@ dist # Other *.DS_Store + +# IDE +.idea +.vscode diff --git a/developer-docs/latest/concepts/configurations.md b/developer-docs/latest/concepts/configurations.md index 602d0c48c5..44d05b84c3 100644 --- a/developer-docs/latest/concepts/configurations.md +++ b/developer-docs/latest/concepts/configurations.md @@ -293,6 +293,9 @@ module.exports = ({ env }) => ({ | ----------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------- | | `responses` | Global API response configuration | Object | | | `responses.privateAttributes` | Set of globally defined attributes to be treated as private. E.g. `_v` when using MongoDb or timestamps like `created_at`, `updated_at` can be treated as private | String array | `[]` | +| `rest` | REST API configuration | Object | | +| `rest.defaultLimit` | Specifies default `_limit` parameter used in API calls | Integer | `100` | +| `rest.maxLimit` | Specifies max allowed number that can be requested as `_limit`. Default to `-1` which fetches all results | Integer | `-1` | ## Functions From 0c664fa9515ff3218ff5316e5213b28670e2731f Mon Sep 17 00:00:00 2001 From: Jozef Cipa Date: Thu, 7 Jan 2021 17:55:52 +0100 Subject: [PATCH 2/3] Update default maxLimit value --- developer-docs/latest/concepts/configurations.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/developer-docs/latest/concepts/configurations.md b/developer-docs/latest/concepts/configurations.md index 44d05b84c3..05a5fea19e 100644 --- a/developer-docs/latest/concepts/configurations.md +++ b/developer-docs/latest/concepts/configurations.md @@ -295,7 +295,7 @@ module.exports = ({ env }) => ({ | `responses.privateAttributes` | Set of globally defined attributes to be treated as private. E.g. `_v` when using MongoDb or timestamps like `created_at`, `updated_at` can be treated as private | String array | `[]` | | `rest` | REST API configuration | Object | | | `rest.defaultLimit` | Specifies default `_limit` parameter used in API calls | Integer | `100` | -| `rest.maxLimit` | Specifies max allowed number that can be requested as `_limit`. Default to `-1` which fetches all results | Integer | `-1` | +| `rest.maxLimit` | Specifies max allowed number that can be requested as `_limit`. Default to `null` which fetches all results | Integer | `null` | ## Functions From fc0632717d79220fda1a598187c3ca18c2c78657 Mon Sep 17 00:00:00 2001 From: Derrick Mehaffy Date: Mon, 11 Jan 2021 08:45:14 -0700 Subject: [PATCH 3/3] Add limit to example code --- developer-docs/latest/concepts/configurations.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/developer-docs/latest/concepts/configurations.md b/developer-docs/latest/concepts/configurations.md index 05a5fea19e..42157ae0e8 100644 --- a/developer-docs/latest/concepts/configurations.md +++ b/developer-docs/latest/concepts/configurations.md @@ -284,6 +284,10 @@ module.exports = ({ env }) => ({ responses: { privateAttributes: ['_v', 'id', 'created_at'], }, + rest: { + defaultLimit: 100, + maxLimit: 250, + }, }); ```