Skip to content

Commit

Permalink
Fixes #821: apply max-object-properties/max-doc-properties only on in…
Browse files Browse the repository at this point in the history
…dexable Objects
  • Loading branch information
tatu-at-datastax committed Jan 29, 2024
1 parent 35e009c commit 01203aa
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
24 changes: 12 additions & 12 deletions CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 01203aa

Please sign in to comment.