github danielgtaylor/huma v2.34.0

latest releases: v2.41.0, v2.40.0, v2.39.1...
17 months ago

Overview

Opt-in for 406 Errors

By default, Huma will fall back to the default format when content negotiation fails to find an appropriate content type that both the client and server can agree on. This enables clients which send no Content-Type header to Just Work ™️, however sometimes that behavior is not desired and you would rather return a 406 Not Acceptable. A new configuration option enables this:

config := huma.DefaultConfig("My API", "1.0.0")
config.NoFormatFallback = true

What's Changed

  • feat: #843 Allow 406 Not Acceptable with NoFormatFallback config by @jh125486 in #850

New Contributors

Full Changelog: v2.33.0...v2.34.0

Don't miss a new huma release

NewReleases is sending notifications on new releases.