Update module github.com/danielgtaylor/huma/v2 to v2.23.0 #7
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v2.22.1
->v2.23.0
Release Notes
danielgtaylor/huma (github.com/danielgtaylor/huma/v2)
v2.23.0
Compare Source
Overview
Pointers for Non-Param Fields
It's now possible to use pointers for non-param fields in input structs without Huma complaining. For example, here the
User
is not a path/query/header param and is populated from theAuthorization
header value for use later:Hidden Field Validation
Hidden fields are now validated properly if they are present in the input. For example:
Prevent Overwriting Schema Validations
All validations now take the existing value of the validator as input when generating the schema, which means a
SchemaProvider
orSchemaTransformer
output won't get overwritten when generating schemas. This fixes a bug that was partially fixed but missed several important fields likepattern
.Non-Addressable Resolver
It's now possible to use non-addressable types which implement
Resolver
, such as custom primitive types as map keys. This is currently a little less efficient as a pointer to the type needs to be generated, but at least it is now possible and performance can be improved in the future.Use the Status Code from
NewError
When providing your own custom
huma.NewError
function, the resulting error's status code was ignored. This has been fixed to be used as the output status code, enabling the function to modify the status code before going out on the wire.NewError with a Context
It's now possible to replace
huma.NewErrorWithContext
so your error generation function has access to the underlying request context.NewWithPrefix & Servers
When using
humago.NewWithPrefix
and not providing any servers, a single server entry is now generated for you with the given prefix.Support
url.URL
ParametersYou can now use a URL as an input path/query/header parameter and it will be parsed/validated for you.
Request Body Generation Improvements
Like response body generation, the request body generation has been improved to generate missing pieces of the body OpenAPI structure. This enables you to easily e.g. add a description but have Huma still generate the JSON Schema for you. Example:
What's Changed
New Contributors
Full Changelog: danielgtaylor/huma@v2.22.1...v2.23.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.