-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: JSON
-
Labels:None
I noticed that JSONSerializers.getStrict() and JSONSerializers.getLegacy() are implemented using the package-accessible com.mongodb.util.ClassMapBasedObjectSerializer class.
In the case of org.bson.types.Binary, the legacy serializer doesn't produce valid JSON; it produces a bare, unquoted string <Binary Data>. The strict serializer produces valid JSON (quoted) string but obviously can be very, very verbose.
I'd like to be able to override the serializer and produce something in between the legacy and strict implementations for Binary: a valid JSON string that's a truncated string representation that the strict implementation outputs. This would require making the com.mongodb.util.ClassMapBasedObjectSerializer public.