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

Fixes #821: apply max-object-properties/max-doc-properties only on indexed Objects #844

Merged
merged 10 commits into from
Jan 31, 2024

Conversation

tatu-at-datastax
Copy link
Contributor

What this PR does:
Changes validation of Document limits so that maximum Object property limits only consider indexed fields.

Which issue(s) this PR fixes:
Fixes #821

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

| `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 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 indexable string value in a document. |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding missing "indexable": was already changed to only validate indexable Strings.

@@ -282,11 +282,6 @@ private void validateObjectValue(
validateDocDepth(limits, depth);

final int propCount = objectValue.size();
if (propCount > limits.maxObjectProperties()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Moved from "full doc" validation to later "indexable only doc" validation.

@tatu-at-datastax tatu-at-datastax marked this pull request as ready for review January 30, 2024 18:34
@tatu-at-datastax tatu-at-datastax requested a review from a team as a code owner January 30, 2024 18:34
Copy link
Contributor

@maheshrajamani maheshrajamani left a comment

Choose a reason for hiding this comment

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

LGTM

@maheshrajamani maheshrajamani merged commit 9ae532d into main Jan 31, 2024
2 checks passed
@maheshrajamani maheshrajamani deleted the tatu/821-max-object-props-no-index branch January 31, 2024 16:27
@tatu-at-datastax
Copy link
Contributor Author

Thank you @maheshrajamani !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document limits: only apply Max Object Properties limits on indexed fields
2 participants