Skip to content

Array parameter in path #34

@ghost

Description

Prerequisites:

type args struct {
    Id   []int64 `path:"id" validate:"dive,required" explode:"1"`
}

fizz.GET("/:id", []fizz.OperationOption{/*...*//}, tonic.Handler(func(ctx *gin.Context, args *args) error {
  fmt.Println(args)
  return nil
}, 200))

Then, when I make a request: curl "http://localhost:8080/1,2,3", I get error: binding error on field 'Id' of type 'args': strconv.ParseInt: parsing "1,2,3": invalid syntax.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions