Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type check should be a little more relaxed #4

Open
zigzago opened this issue Oct 5, 2019 · 1 comment
Open

Type check should be a little more relaxed #4

zigzago opened this issue Oct 5, 2019 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@zigzago
Copy link
Collaborator

zigzago commented Oct 5, 2019

I have an object with a Long property, but the value is stored as Double. When I try to deserialize it:

org.bson.BsonInvalidOperationException: Value expected to be of type INT64 is of unexpected type DOUBLE

	at org.bson.BsonValue.throwIfInvalidType(BsonValue.java:419)
	at org.bson.BsonValue.asInt64(BsonValue.java:105)
	at com.github.jershell.kbson.BsonDocumentDecoder.decodeTaggedLong(BsonDocumentDecoder.kt:198)
	at com.github.jershell.kbson.BsonDocumentDecoder.decodeTaggedLong(BsonDocumentDecoder.kt:30)
	at kotlinx.serialization.TaggedDecoder.decodeLongElement(Tagged.kt:238)

It would be a nice addition to cast the value when it is doable

@jershell
Copy link
Owner

jershell commented Oct 7, 2019

Litote/kmongo#104

@jershell jershell added enhancement New feature or request help wanted Extra attention is needed labels Oct 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants