You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Auto-generated Documentation
This PR was generated automatically by the Claude Auto Docs workflow.
**Source repository:** `intility/Intility.JsonApiToolkit`
**Source PR:**
#116
> **Note**
> Review all generated content carefully before merging.
Co-authored-by: intility-claude[bot] <2458755+intility-claude[bot]@users.noreply.github.com>
- By default, invalid pagination values (page number less than 1, page size exceeding `MaxPageSize`) are silently clamped to valid ranges. Enable `StrictPagination` to return 400 errors instead (see [Security](security.md#strict-pagination)).
38
39
39
40
-**Inclusion (`include`):**
40
41
Specify which related resources should be included in the response.
@@ -121,7 +122,7 @@ JsonApiToolkit enforces the following query limits to ensure predictable perform
|`MaxFilterValueLength`| Returns 400 Bad Request |
110
111
|`MaxIncludeDepth`| Returns 400 Bad Request |
111
-
|`MaxPageSize`|Silently clamped to max value|
112
+
|`MaxPageSize`|Clamped (default) or 400 Bad Request (`StrictPagination`)|
112
113
113
114
### Error Response
114
115
@@ -168,6 +169,50 @@ When filtering on a non-allowed relationship:
168
169
> [!NOTE]
169
170
> This validation only applies when `[AllowedIncludes]` is present. Without the attribute, all filter paths are allowed.
170
171
172
+
## Strict Pagination
173
+
174
+
By default, JsonApiToolkit silently clamps invalid pagination parameters to valid ranges for backwards compatibility. Enable `StrictPagination` to return 400 Bad Request errors instead.
175
+
176
+
### Configuration
177
+
178
+
```csharp
179
+
builder.Services.AddJsonApiToolkit(options=> {
180
+
options.StrictPagination=true;
181
+
});
182
+
```
183
+
184
+
### Behavior
185
+
186
+
When `StrictPagination` is enabled, the following values are rejected with 400 Bad Request:
187
+
188
+
-`page[number]` less than 1 (e.g., `page[number]=0` or `page[number]=-5`)
189
+
-`page[size]` less than 1 (e.g., `page[size]=0` or `page[size]=-10`)
190
+
-`page[size]` exceeding `MaxPageSize` (e.g., `page[size]=200` when `MaxPageSize=100`)
191
+
192
+
When disabled (default), these values are silently clamped:
0 commit comments