orlandos-nl / BSON

Native Swift library for BSON (http://bsonspec.org)
https://orlandos.nl/docs/mongokitten/articles/bson
MIT License
109 stars 35 forks source link

BSONEncoder/Decoder supports convertFrom/ToSnakeCase? #67

Closed Linkadi98 closed 2 years ago

Linkadi98 commented 3 years ago

Hi, while I am decoding my Document, I can see that BSONDecoder doesn't treat my snake case key like standard swift JSONDecoder with option convertFromSnakeCase in KeyCodingStrategy. I have to explicit use CodingKey to map snake case to camel case very handy. Also, I go to BSONDecoder implementation and it seems like don't have any options like convertFromSnakeCase. As my question, BSON will handle this option or something which will handle this?

Thanks!