SamboyCoding / Tomlet

Zero-Dependency, model-based TOML De/Serializer for .NET
MIT License
155 stars 29 forks source link

Implement deserialization of dictionaries using primitives as keys #44

Closed Sprixitite closed 1 month ago

Sprixitite commented 1 month ago

Previously only worked with strings and would fail quietly if anything else was used (at least on net8.0, haven't checked other targets)

coveralls commented 1 month ago

Coverage Status

coverage: 91.979% (+0.03%) from 91.945% when pulling db9998bcd3093ac4857f0b90df24932ce0256e34 on Sprixitite:master into a572b42333c7720c9a1e0c57fd907c35d635e0a7 on SamboyCoding:master.

Sprixitite commented 1 month ago

With regards to deserializing generic dictionaries (as there currently is a naive serializer for them), it'll probably be necessary to expose an interface to convert objects -> keys and back

Another approach would be to serialize the keys and use the resulting string as the key? Would like to hear some thoughts on this

SamboyCoding commented 1 month ago

Content looks good but I would like to have a test to ensure it's valid and doesn't break in future.

Sprixitite commented 1 month ago

Good call on adding the tests, I evidently didn't check the floating point stuff well enough, some issues with the decimal point

I've removed double/float support from this PR as a result