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

Prefer to load custom property codec providers before default codec providers. #3038

Conversation

danielmerchant
Copy link

Like the PR title says - prefer to load user-defined custom property codec providers before the library default codec providers. This allows users to override default behavior to provide customizable codec logic for Map and Collection types, as well as their subclasses.

Added a test here to validate that the NoOp provider I added would load correctly, but I had to add it in a package separate from the existing tests to get access to the protected methods. Not sure if that's something I should avoid here, but generally it's considered good practice to have unit tests live in the same package as the source it's testing. I also had to add a META-INF/services/MorphiaPropertyCodecProvider file here to add the No-Op codec provider so that the service loader could access it. I tried monkeying around with ways to get it to load for only the test I wrote, but no avail.

@evanchooly evanchooly added this to the 2.4.14 milestone May 23, 2024
@evanchooly evanchooly added the bug label May 23, 2024
@evanchooly evanchooly merged commit 23b0583 into MorphiaOrg:2.4.x May 23, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants