-
Notifications
You must be signed in to change notification settings - Fork 1.4k
v2: can't parse numeric value of "maximum" tag #2153
Copy link
Copy link
Open
Description
Describe the bug
Parsing a struct with a float64 field having a floating point minimum/maximum value fails with message:
Error parsing type definition 'CreateInput': can't parse numeric value of "maximum" tag: strconv.Atoi: parsing "0.1": invalid syntax
To Reproduce
type CreateInput struct {
Factor *float64 `json:"factor" validate:"required" minimum:"0" maximum:"0.1" example:"0.04"`
}
// @Summary Create Something
// @Accept json
// @Produce json
// @Param Payload body CreateInput true "Request Body"
// @Router /something/create [post]
func Create() {}
Expected behavior
No error is generated and proper OpenAPI v3 model is generated.
Screenshots
If applicable, add screenshots to help explain your problem.
Your swag version
v2.0.0
Your go version
1.25.8
Desktop (please complete the following information):
- OS: MacOS
- Browser: n.a.
- Version: 26.3.1
Additional context
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels