-
-
Notifications
You must be signed in to change notification settings - Fork 320
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix msgspec template to add field #1942
Fix msgspec template to add field #1942
Conversation
566fb56
to
cf683e4
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1942 +/- ##
=======================================
Coverage ? 98.90%
=======================================
Files ? 37
Lines ? 4186
Branches ? 973
=======================================
Hits ? 4140
Misses ? 29
Partials ? 17
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging #1942 will not alter performanceComparing Summary
|
With msgspec outputs, the order of generated fields sometimes results in invalid class definitions, with required and optional fields in the wrong order. Additionally, if using
--snake-case-field
, field aliases are not added.This PR contains the following fixes:
_has_field_assignment
sort function is modified to sort optional fields last__str__
function for msgspec fields is updated to add an explicitNone
default for optional fields when no other default has been set.field.field
for annotated types.test_main.py
.Fixes #1943
Fixes #1919
Fixes #1920