Skip to content

Conversation

bamapookie
Copy link

@bamapookie bamapookie commented Oct 6, 2025

  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

Copyright date already set to 2025. No new files. No author lists in files I touched, so I left my name out.

Fixes #5065

@bamapookie bamapookie force-pushed the 5065-empty-map-with-document-reference branch from 8c296c4 to 18d87d6 Compare October 7, 2025 14:10
Copy link
Member

@christophstrobl christophstrobl left a comment

Choose a reason for hiding this comment

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

Thank you for taking the time to prepare this PR.
Kindly let me know if you'd like to add the tests from the review comment. If not, I can take it from here and continue the work.

@Test // GH-5065
@DisplayName("Converter should read an empty object as an empty map with a valis values property when using @DocumentReference(lazy = true).")
void readsEmptyMapWithLazyLoadedDocumentReferenceCorrectly() {
org.bson.Document document = org.bson.Document.parse("{\"map\":{}}");
Copy link
Member

Choose a reason for hiding this comment

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

I think it would also be interesting to have test for { 'map' : null } expecting null for the target.map.

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.

Document with Map decorated with @NonNull and @DocumentReference fails to deserialize

3 participants