Skip to content

Conversation

@sri-adarsh-kumar
Copy link
Contributor

@sri-adarsh-kumar sri-adarsh-kumar commented Oct 25, 2025

Add documentation in joda-money/README.md for the new @JodaMoney annotation.

Sorry, this was missed in #76

sri-adarsh-kumar and others added 9 commits October 21, 2025 16:11
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]>
- 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
Copy link
Member

@sri-adarsh-kumar All good. Thanks!

@cowtowncoder cowtowncoder merged commit 292ffe7 into FasterXML:3.x Oct 26, 2025
3 checks passed
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants