-
Notifications
You must be signed in to change notification settings - Fork 23
Add field-level amount representation for Joda-Money module #77
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
Merged
cowtowncoder
merged 9 commits into
FasterXML:3.x
from
sri-adarsh-kumar:feature/joda-money-field-level-amount-representation
Oct 26, 2025
Merged
Add field-level amount representation for Joda-Money module #77
cowtowncoder
merged 9 commits into
FasterXML:3.x
from
sri-adarsh-kumar:feature/joda-money-field-level-amount-representation
Oct 26, 2025
Conversation
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
Implements per-property override of amount representation to complement the module-level default introduced in PR FasterXML#17. Changes: - Add DEFAULT value to AmountRepresentation enum to represent "inherit module config" - Add @jsonmoney annotation for field-level configuration - Make MoneySerializer and MoneyDeserializer contextual to support per-property resolution - Support @jsonformat(shape=...) mapping: STRING→DECIMAL_STRING, NUMBER/NUMBER_FLOAT→DECIMAL_NUMBER, NUMBER_INT→MINOR_CURRENCY_UNIT - Precedence: @jsonmoney > @jsonformat > module default > built-in default - Full mix-in support via Jackson's standard BeanProperty API - Maintain backward compatibility for unannotated fields Tests: - Add MoneyFieldLevelRepresentationTest with 12 tests covering field/getter/constructor annotations, mixed configurations, precedence, and mix-ins - Add MoneyFormatShapeMappingTest with 9 tests covering shape mappings and multiple fields - All 94 tests pass (21 new, 73 existing with no regression) Fixes FasterXML#18 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
…field-level-amount-representation
- Update package structure from com.fasterxml.jackson to tools.jackson - Adapt MoneySerializer for Jackson 3.x API (SerializationContext, JacksonException) - Adapt MoneyDeserializer for Jackson 3.x API - Update JsonMoney annotation package - Update test files package declarations and imports - Maintain field-level amount representation feature compatibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
- Fix Jackson 3.x API compatibility: use MapperBuilder.addMixIn() instead of ObjectMapper.addMixIn() - Replace AssertJ assertions with JUnit assertions (assertTrue, assertEquals) - Fix import statements to use correct Jackson 3.x package names - Update MoneySerializer and MoneyDeserializer to implement contextual serialization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Renamed the @jsonmoney annotation to @JodaMoney for better alignment with the module naming convention. This change updates: - Annotation interface name from JsonMoney to JodaMoney - All references in serializer and deserializer classes - All test cases and documentation examples 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Add documentation for the @JodaMoney annotation in README, showing how to override amount representation at the field level. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
cowtowncoder
approved these changes
Oct 26, 2025
Member
|
@sri-adarsh-kumar All good. Thanks! |
cowtowncoder
approved these changes
Oct 26, 2025
cowtowncoder
added a commit
that referenced
this pull request
Oct 26, 2025
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.
Add documentation in
joda-money/README.mdfor the new@JodaMoneyannotation.Sorry, this was missed in #76