-
Type: Improvement
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: Kotlin
Kotlinx requires the encoder to implement JsonEncoder and JsonDecoder in order to encode generic JsonElement types.
The lack of this support for this came up many times when using KBson and KMongo previously and I'm hoping we can quickly mitigate this now that MongoDB has official support.
I've added each implementation to support most types on decoding and determine the best possible type on encoding to insert. It is somewhat assumed that if someone is encoding a JsonElement, then they will probably be decoding one as well and, therefore, type information is primarily for storage optimization.
Unfortunately, Kotlinx writes all numbers as 64 bit integers first and never attempts to check for 32 bits or allow overriding the JsonElementSerializer behavior; this means that all integers will probably be written as int64. Regardless, this should be a valuable add.
- causes
-
JAVA-5623 BsonEncoder and BsonDecoder visibility changed to internal
- Closed