Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing pagination properties #2404

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
38 changes: 37 additions & 1 deletion schemas/dab.draft.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,29 @@
"description": "Runtime configuration settings",
"additionalProperties": false,
"properties": {
"pagination": {
"type": "object",
"properties": {
"max-page-size": {
"type": [
"integer",
"null"
],
"description": "Defines the maximum number of records that can be returned in a single page of results. If set to null, the default value is 100,000.",
"default": 100000,
"minimum": 1
},
"default-page-size": {
"type": [
"integer",
"null"
],
"description": "Sets the default number of records returned in a single response. When this limit is reached, a continuation token is provided to retrieve the next page. If set to null, the default value is 100.",
"default": 100,
"minimum": 1
}
}
},
"rest": {
"type": "object",
"description": "Global REST endpoint configuration",
Expand Down Expand Up @@ -177,7 +200,10 @@
"description": "Allow enabling/disabling GraphQL requests for all entities."
},
"depth-limit": {
"type": [ "integer", "null" ],
"type": [
"integer",
"null"
],
"description": "Maximum allowed depth of a GraphQL query.",
"default": null
},
Expand Down Expand Up @@ -207,6 +233,16 @@
"description": "Global hosting configuration",
"additionalProperties": false,
"properties": {
"max-response-size-mb": {
"type": [
"integer",
"null"
]
"description": "Specifies the maximum size, in megabytes, of the database response allowed in a single result. If set to null, the default value is 158 MB.",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is default value = 158 MB? Why not some power of 2 for e.g. 128 or 256?

Copy link
Contributor

Choose a reason for hiding this comment

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

See #2242:

public record HostOptions
{
/// <summary>
/// Dab engine can at maximum handle 158 MB of data in a single response from a source.
/// Json deserialization of a response into a string has a limit of 166,666,666 bytes which when converted to MB is 158 MB.
/// ref: enforcing code:
/// .net8: https://github.com/dotnet/runtime/blob/v6.0.0/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.cs#L80
/// .net6: https://github.com/dotnet/runtime/blob/v8.0.0/src/libraries/System.Text.Json/src/System/Text/Json/Writer/JsonWriterHelper.cs#75
/// ref: Json constant: https://github.com/dotnet/runtime/blob/main/src/libraries/System.Text.Json/src/System/Text/Json/JsonConstants.cs#L80
/// </summary>
public const int MAX_RESPONSE_LENGTH_DAB_ENGINE_MB = 158;

"default": 158,
"minimum": 1,
"maximum": 158
},
"mode": {
"description": "Set if running in Development or Production mode",
"type": "string",
Expand Down