Skip to content

v2.14.0

Compare
Choose a tag to compare
@danielgtaylor danielgtaylor released this 22 Apr 16:05
· 295 commits to main since this release
be8cf67

Overview

Support for netip.Addr Type

In addition to a net.IP, request inputs can now use a netip.Addr type, passing in a value like 127.0.0.1 from the client in e.g. query params and it will parse into the correct type with validation.

Error Wrapping Improvements

Arbitrary headers can now be added if needed by wrapping errors. For example:

return nil, huma.ErrorWithHeaders(
	huma.Error404NotFound("thing not found"),
	http.Header{
		"Cache-Control": {"no-store"},
	},
)

This uses Go's built-in error wrapping functionality and works via errors.Is/errors.As for any error which satisfies the huma.HeadersError interface.

What's Changed

New Contributors

Full Changelog: v2.13.1...v2.14.0