Skip to content

Commit

Permalink
Merge pull request #625 from monstermunchkin/misc/validation
Browse files Browse the repository at this point in the history
shared/definition: Fix unmarshalling of DefinitionFilterType
  • Loading branch information
monstermunchkin authored Apr 22, 2022
2 parents 1176400 + 22bf998 commit 83f5f26
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion shared/definition.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const (
)

// UnmarshalYAML validates the filter type.
func (d DefinitionFilterType) UnmarshalYAML(unmarshal func(interface{}) error) error {
func (d *DefinitionFilterType) UnmarshalYAML(unmarshal func(interface{}) error) error {
var filterType string

err := unmarshal(&filterType)
Expand All @@ -53,6 +53,8 @@ func (d DefinitionFilterType) UnmarshalYAML(unmarshal func(interface{}) error) e
return fmt.Errorf("Invalid filter type %q", filterType)
}

*d = DefinitionFilterType(filterType)

return nil
}

Expand Down

0 comments on commit 83f5f26

Please sign in to comment.