Skip to content
Discussion options

You must be logged in to vote

Hi @joa23! Sorry this sat for so long.

Yes, this functionality is supported natively by Huma! Here's an example:

package main

import (
	"context"
	"fmt"
	"net/http"

	"github.com/danielgtaylor/huma/v2"
	"github.com/danielgtaylor/huma/v2/adapters/humachi"
	"github.com/danielgtaylor/huma/v2/humacli"
	"github.com/go-chi/chi/v5"
)

// Options for the CLI.
type Options struct {
	Port int `help:"Port to listen on" short:"p" default:"8888"`
}

// TokenInput represents the OAuth2 token request (RFC 6749 section 4.3.2).
// Huma will automatically handle `application/x-www-form-urlencoded` for this.
type TokenInput struct {
	Body struct {
		GrantType    string `json:"grant_type" doc:"The type of g…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@wolveix
Comment options

wolveix Feb 19, 2026
Collaborator

Answer selected by wolveix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants