Closed neallester closed 6 years ago
From our conversation on slack:
Anything in the above that does not get fixed before merging should get an issue on github after merging.
I wrote a test which deserializes an object with the attributes in the following pattern and it passes. I thought I had found all the locations where the BSONDecoder is created and passed along the userInfo, although it’s certainly possible I missed some.
var customType: CustomTypeUsingUserInfo var other: OtherEntity var customType: CustomTypeUsingUserInfo
So it looks like userInfo is passed back up.
I don’t have an immediate need for encoders so I didn’t implement them.
Neither of the v6 branches I tried gave me passing tests. Which branch should I submit an updated pull request (with the additional test) on?
@Obbut We should have a look at this tuesday
The new en/de-coders in BSON 6 should already support this. As for the behavior of passing back up, I think we should look at the behavior of the Foundation encoders, and copy that.
Edit: sorry, I accidentally pressed "close & comment" instead of comment 😬
I found a work around for the minor SPM bug which was preventing me from working against my own forked version of BSON which includes this patch. I'm finding some small additional changes which will be required in the patch so at this point it makes more sense to wait until I finish this work and I can then resubmit the patch updated or maybe just skip straight to v6.
This change enables application developers to set BSONDecoder.userInfo. A test was added in BSONCodableTests and it passes on High Sierra but it appears that none of the BSONCodableTests run on Linux so it has not been run there.