Skip to content

fix(java): preserve JSON object field semantics - #4141

Closed
chaokunyang wants to merge 1 commit into
apache:mainfrom
chaokunyang:fix/json-issues-4136-4140
Closed

chaokunyang wants to merge 1 commit into
apache:mainfrom
chaokunyang:fix/json-issues-4136-4140

Conversation

@chaokunyang

Copy link
Copy Markdown
Collaborator

Summary

  • Restore eligible final fields when reading JSON and select the subclass field when it hides a superclass field.
  • Reject writes through a concrete declared object type when the runtime value is a different subclass, preventing silent field loss without subtype metadata.
  • Consult registered JsonCodecFactory implementations for declared Object values inside containers.
  • Document the resulting object mapping and factory behavior.

Fixes #4136
Fixes #4137
Fixes #4139
Fixes #4140

Testing

  • ENABLE_FORY_DEBUG_OUTPUT=1 mvn -T16 -pl fory-json -am install -DskipTests
  • ENABLE_FORY_DEBUG_OUTPUT=1 mvn -pl fory-json test (1,284 tests passed)
  • mvn -pl fory-json spotless:check checkstyle:check
  • prettier --write docs/json/object-mapping.md docs/json/custom-codecs.md

@chaokunyang chaokunyang closed this Oct 8, 2026
@chaokunyang
chaokunyang deleted the fix/json-issues-4136-4140 branch October 8, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant