Skip to content

How to validate slice of struct field #88

Open
@bhill77

Description

@bhill77

If I have struct like this:

type Contact struct {
	Type string `json:"type"`
	Value string `json:"value"`
}

type User struct {
	Name string `json:"name"`
	Contacts []Contact `json:"contacts"`
}

How to validate contact Type and value?

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