Skip to content

GH-3121 Throw PropertyReferenceException for whitespace-starting Prop… #3321

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mipo256
Copy link
Contributor

@mipo256 mipo256 commented Jul 10, 2025

Closes #3121

So, actually, the situation that is described in the original ticket is quite flawed in many ways.

My basic assumption is that PropertyPath cannot hold whitespace holding properties. Now, the way it works with properties. key as the PropertyPath in spring data mongodb - it actually don't, we still were unable to parse the PropertyPath, but we handed the exception - the PropertyReferenceException.

The mongodb can handles property references like properties. key, so the spring-data-mongodb just passed it literally as

{ $set : { "properties. key" : "value" }  }

and the mongodb engine would figure it out.

Therefore, I think, that the only correct fix that can be applied here is to just throw a correct exception, which is PropertyReferenceException. The properties. key and properties. Key should not be considered valid PropertyPath instances.

CC: @christophstrobl @mp911de

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 10, 2025
@mipo256
Copy link
Contributor Author

mipo256 commented Jul 11, 2025

I'll add the Integration test for mongodb to make sure that this case works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Property path with whitespace inconsistently throws exception
2 participants