Thanks to visit codestin.com
Credit goes to github.com

Skip to content

如何验证结构体切片类型数据 #213

@hellolxc

Description

@hellolxc

请问如何验证像下面这种数据类型?在批量创建时会遇到此类问题

type Form struct {
	Data []Person `validate:"required"`
}

type Person struct {
	Name string `json:"name" validate:"required"`
	Age  int    `json:"age" validate:"required"`
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions