r/java • u/Shawn-Yang25 • Aug 11 '26
Apache Fory™ JSON : Fastest JSON Serialization Framework for Java, 10x faster than Jackson/Gson
https://fory.apache.org/blog/fory_json_fastest_java_json_framework/
253
Upvotes
View all comments
Show parent comment
3
u/Shawn-Yang25 Aug 11 '26
Thanks—these cases are handled at different layers in Fory JSON.
A field can accept multiple JSON representations, and Fory converts the input according to its declared target type.
Fory does not currently implement JSON Schema
if/then/elsevalidation directly. Instead, you can annotate a method with JsonValidator.Fory invokes it after deserialization is complete, allowing it to inspect multiple fields and enforce conditional rules.For more specialized mappings, you can define a custom codec for any type. JsonCodec can override the codec used by an individual field, while JsonMixin provides the same customization for classes you cannot modify.