schema using 'patternProperties' with square bracket character classes gets interpreted as array access#8522
Closed
KampfCaspar wants to merge 2 commits into
Closed
schema using 'patternProperties' with square bracket character classes gets interpreted as array access#8522KampfCaspar wants to merge 2 commits into
KampfCaspar wants to merge 2 commits into
Conversation
Author
|
It seems the issue resides in plugins/dev-mode/check-schema, while patternProperties seem to be excluded in validateFieldsDeep (line 78), it is not handled in checkSchema (line 501). The block seems to check for an older configuration variant with 'index: true' on individual fields. I don't know if that ever worked for patternProperties - the 'flattened' object path and regex syntax just don't mix. I therefore suggest excluding patternProperties from this old-config check. |
Copilot AI
added a commit
that referenced
this pull request
May 26, 2026
…#8522) Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/832b1569-3c4f-442b-b40a-dcd34bbca5ed Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
pubkey
added a commit
that referenced
this pull request
May 26, 2026
…#8522) (#8577) Agent-Logs-Url: https://github.com/pubkey/rxdb/sessions/832b1569-3c4f-442b-b40a-dcd34bbca5ed Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: pubkey <8926560+pubkey@users.noreply.github.com>
Owner
|
Fixed at #8577 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains:
BUG TEST CASE
Describe the problem
I want to include objects as fields in an RxJsonSchema. If I specify that deep objects properties by patternProperties I want
to use character classes in the regex. rxdb seems to interpret the square brackets (originating from the regex character classes) as indicating array indizes and bails out.
Describe solution
Regexs in patternProperties should NOT be interpreted as array indizes - at least not directly. If such indizes serve a purpose, only interpret square brackets that are not part of the regex as such (e.g. escaped by backslash for a 'literal' square bracket).