Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(deps): update module github.com/danielgtaylor/huma/v2 to v2.17.0 #23

Merged
merged 1 commit into from
May 20, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented May 20, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
github.com/danielgtaylor/huma/v2 v2.16.0 -> v2.17.0 age adoption passing confidence

Release Notes

danielgtaylor/huma (github.com/danielgtaylor/huma/v2)

v2.17.0

Compare Source

Overview

Convenience Method Operation Modifiers

You can now add modifier functions when registering operations using convenience methods like huma.Get:

func OperationTags(tags ...string) func(o *Operation) {
	return func(o *Operation) {
		o.Tags = tags
	}
}

huma.Get(api, "/demo", myHandler, OperationTags("one", "two"))

Use this to build out whatever functionality you need to simplify registration. These can also be composed & joined easily to give a concise way to register operations without falling back to huma.Register directly.

Request Remote Address Access

It's now possible to access the requests's RemoteAddr field through huma.Context for use in middleware and/or resolvers, which works with all routers:

func MyMiddleware(ctx huma.Context, next func(huma.Context)) {
	fmt.Println("Request address", ctx.RemoteAddr())
	next(ctx)
}
Fix Unmarshaling of Embedded Body

Unmarshaling of embedded structs with a body field now works as expected:

type BodyContainer struct {
	Body struct {
		Name string `json:"name"`
	}
}

huma.Register(api, huma.Operation{
	Method: http.MethodPost,
	Path:   "/body",
}, func(ctx context.Context, input *struct {
	BodyContainer
}) (*struct{}, error) {
	// Do something with `input.Body.Name`...
	return nil, nil
})

What's Changed

New Contributors

Full Changelog: danielgtaylor/huma@v2.16.0...v2.17.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@odrling odrling merged commit 6eab857 into master May 20, 2024
10 checks passed
@odrling odrling deleted the renovate/github.com-danielgtaylor-huma-v2-2.x branch May 20, 2024 20:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant