Closed lennycampino closed 4 months ago
I want to use the https://github.com/shopspring/decimal library for handling decimals and huma will detect decimal.Decimal as object but it is a string.
So I implemented the following code:
type Decimal decimal.Decimal func (d *Decimal) Schema(r huma.Registry) *huma.Schema { return &huma.Schema{Type: huma.TypeString} } type Request struct { Amount Decimal `json:"amount"` }
This will work but when Amount becomes a Pointer
type Request struct { Amount *Decimal `json:"amount"` }
It will not work anymore and Huma will treat the field amount as object again. Could you please help me with that?
I want to use the https://github.com/shopspring/decimal library for handling decimals and huma will detect decimal.Decimal as object but it is a string.
So I implemented the following code:
This will work but when Amount becomes a Pointer
It will not work anymore and Huma will treat the field amount as object again. Could you please help me with that?