jcrist / msgspec

A fast serialization and validation library, with builtin support for JSON, MessagePack, YAML, and TOML
https://jcristharif.com/msgspec/
BSD 3-Clause "New" or "Revised" License
2.01k stars 59 forks source link

Preserve leading `_` for camel/pascal renaming #620

Closed jcrist closed 6 months ago

jcrist commented 6 months ago

Previously leading underscores were stripped when renaming fields to a camelCase or PascalCase convention. We now preserve leading underscores, better matching the behavior and conventions of other libraries.

Before: _field_one -> fieldOne Now: _field_one -> _fieldOne

Fixes #618.