github danielgtaylor/huma v2.31.0

latest releases: v2.40.0, v2.39.1, v2.39.0...
20 months ago

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:

  1. Start with all fields required.
  2. If a field has omitempty, it is optional.
  3. If a field has omitzero, it is optional.
  4. If a field has required:"false", it is optional.
  5. If a field has required:"true", it is required.

See https://huma.rocks/features/request-validation/#optional-required for more info.

What's Changed

New Contributors

Full Changelog: v2.30.0...v2.31.0

Don't miss a new huma release

NewReleases is sending notifications on new releases.