Closed peterschutt closed 11 months ago
This was "intended behavior" in that we had a test checking for this behavior, but it also wasn't extremely well thought out :). I agree that preserving leading underscores would be more ergonomic in these cases, and am happy to make a small change to fix this. Should be resolved by #620.
Thanks @jcrist!
Description
Hi there and as always, thanks for the work you put into msgspec!
I'm decoding from a source that uses camelCase names, but also includes a
"_links"
key.Decoding into a struct with
rename="camel"
results in aValidationError
for that field.Easy as pie workaround is to declare
= msgspec.field(name="_links")
, so no blocker, but I wanted to check that this is the intended behavior.One related data point is that the
inflection
library doesn't strip leading underscores when camelizing: