diff --git a/adapters/humagin/humagin.go b/adapters/humagin/humagin.go index b28d0e49..1092ffdd 100644 --- a/adapters/humagin/humagin.go +++ b/adapters/humagin/humagin.go @@ -130,6 +130,11 @@ func (c *ginCtx) Version() huma.ProtoVersion { } } +// NewContext creates a new Huma context from a Gin context +func NewContext(op *huma.Operation, c *gin.Context) huma.Context { + return &ginCtx{op: op, orig: c} +} + // Router is an interface that wraps the Gin router's Handle method. type Router interface { Handle(string, string, ...gin.HandlerFunc) gin.IRoutes