v2.31.0
Overview
Go 1.24 omitzero Support!
Huma now supports Go's new JSON omitzero feature out of the box, treating it similar to the existing omitempty in terms of making fields optional. The updated rules for optional fields now look like this:
- Start with all fields required.
- If a field has
omitempty, it is optional. - If a field has
omitzero, it is optional. - If a field has
required:"false", it is optional. - If a field has
required:"true", it is required.
See https://huma.rocks/features/request-validation/#optional-required for more info.
What's Changed
- Add 'omitzero' support to mark optional fields by @JasirZaeem in #742
- docs: fix typo in groups by @shadow3x3x3 in #746
New Contributors
- @JasirZaeem made their first contribution in #742
- @shadow3x3x3 made their first contribution in #746
Full Changelog: v2.30.0...v2.31.0