From 01203aa30a0765b8864eb795e2910a38c0f50d9c Mon Sep 17 00:00:00 2001 From: Tatu Saloranta Date: Mon, 29 Jan 2024 15:37:53 -0800 Subject: [PATCH] Fixes #821: apply max-object-properties/max-doc-properties only on indexable Objects --- CONFIGURATION.md | 24 +++++++++---------- .../jsonapi/config/DocumentLimitsConfig.java | 10 ++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/CONFIGURATION.md b/CONFIGURATION.md index 57b19b1dd4..f344ea68d3 100644 --- a/CONFIGURATION.md +++ b/CONFIGURATION.md @@ -23,18 +23,18 @@ Here are some Stargate-relevant property groups that are necessary for correct s ## Document limits configuration *Configuration for document limits, defined by [DocumentLimitsConfig.java](src/main/java/io/stargate/sgv2/jsonapi/config/DocumentLimitsConfig.java).* -| Property | Type | Default | Description | -|-----------------------------------------------------------------|-------|-------------|--------------------------------------------------------------------------------------| -| `stargate.jsonapi.document.limits.max-size` | `int` | `1_000_000` | The maximum size of (in characters) a single document. | -| `stargate.jsonapi.document.limits.max-depth` | `int` | `16` | The maximum document depth (nesting). | -| `stargate.jsonapi.document.limits.max-property-name-length` | `int` | `100` | The maximum length of property names in a document for an individual segment. | -| `stargate.jsonapi.document.limits.max-property-path-length` | `int` | `250` | The maximum length of property paths in a document (segments and separating periods) | -| `stargate.jsonapi.document.limits.max-object-properties` | `int` | `1000` | The maximum number of properties any single object in a document can contain. | -| `stargate.jsonapi.document.limits.max-document-properties` | `int` | `2000` | The maximum total number of properties all objects in a document can contain. | -| `stargate.jsonapi.document.limits.max-number-length` | `int` | `100` | The maximum length (in characters) of a single number value in a document. | -| `stargate.jsonapi.document.limits.max-string-length-in-bytes` | `int` | `8000` | The maximum length (in bytes) of a single string value in a document. | -| `stargate.jsonapi.document.limits.max-array-length` | `int` | `1000` | The maximum length (in elements) of a single indexable array in a document. | -| `stargate.jsonapi.document.limits.max-vector-embedding-length` | `int` | `4096` | The maximum length (in floats) of the $vector in a document. | +| Property | Type | Default | Description | +|-----------------------------------------------------------------|-------|-------------|-----------------------------------------------------------------------------------------| +| `stargate.jsonapi.document.limits.max-size` | `int` | `1_000_000` | The maximum size of (in characters) a single document. | +| `stargate.jsonapi.document.limits.max-depth` | `int` | `16` | The maximum document depth (nesting). | +| `stargate.jsonapi.document.limits.max-property-name-length` | `int` | `100` | The maximum length of property names in a document for an individual segment. | +| `stargate.jsonapi.document.limits.max-property-path-length` | `int` | `250` | The maximum length of property paths in a document (segments and separating periods) | +| `stargate.jsonapi.document.limits.max-object-properties` | `int` | `1000` | The maximum number of properties any single indexable object in a document can contain. | +| `stargate.jsonapi.document.limits.max-document-properties` | `int` | `2000` | The maximum total number of properties all indexable objects in a document can contain. | +| `stargate.jsonapi.document.limits.max-number-length` | `int` | `100` | The maximum length (in characters) of a single number value in a document. | +| `stargate.jsonapi.document.limits.max-string-length-in-bytes` | `int` | `8000` | The maximum length (in bytes) of a single string value in a document. | +| `stargate.jsonapi.document.limits.max-array-length` | `int` | `1000` | The maximum length (in elements) of a single indexable array in a document. | +| `stargate.jsonapi.document.limits.max-vector-embedding-length` | `int` | `4096` | The maximum length (in floats) of the $vector in a document. | ## Operations configuration *Configuration for the operation execution, defined by [OperationsConfig.java](src/main/java/io/stargate/sgv2/jsonapi/config/OperationsConfig.java).* diff --git a/src/main/java/io/stargate/sgv2/jsonapi/config/DocumentLimitsConfig.java b/src/main/java/io/stargate/sgv2/jsonapi/config/DocumentLimitsConfig.java index 251ef51de0..8a36f288a7 100644 --- a/src/main/java/io/stargate/sgv2/jsonapi/config/DocumentLimitsConfig.java +++ b/src/main/java/io/stargate/sgv2/jsonapi/config/DocumentLimitsConfig.java @@ -88,17 +88,17 @@ public interface DocumentLimitsConfig { int maxPropertyPathLength(); /** - * @return Defines the maximum number of properties any single Object in JSON document can - * contain, defaults to {@code 1,000} (note: this is not the total number of properties in the - * whole document, only on individual main or sub-document) + * @return Defines the maximum number of properties any single indexable Object in JSON document + * can contain, defaults to {@code 1,000} (note: this is not the total number of properties in + * the whole document but in the main or indexable sub-document) */ @Positive @WithDefault("" + DEFAULT_MAX_OBJECT_PROPERTIES) int maxObjectProperties(); /** - * @return Defines the maximum number of properties the whole JSON document can contain, defaults - * to {@code 2,000}, including Object- and Array-valued properties. + * @return Defines the maximum number of indexable properties in JSON document can contain, + * defaults to {@code 2,000}, including all indexable Object- and Array-valued properties. */ @Positive @WithDefault("" + DEFAULT_MAX_DOC_PROPERTIES)