Skip to content

validate a values of map #21

@chaehni

Description

@chaehni

I use fig to initialize a map of structs.
The fields in the struct have a "required" validation tag. However, fig does not enforce this validation.
E.g.

type Config struct {
Elements map[string]Element fig:"chartConfigs" validate:"required"
}

type Element struct {
Name string fig:"name" validate:"required"
}

var cfg Config
fig.Load(&cfg)

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