Skip to content

Commit

Permalink
Merge pull request #8 from coder/f0ssel/enum-yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
f0ssel authored Mar 18, 2024
2 parents ae1178c + 0d2ed47 commit c842d75
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions values.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,17 @@ func (e *Enum) String() string {
return *e.Value
}

func (e *Enum) MarshalYAML() (interface{}, error) {
return yaml.Node{
Kind: yaml.ScalarNode,
Value: e.String(),
}, nil
}

func (e *Enum) UnmarshalYAML(n *yaml.Node) error {
return e.Set(n.Value)
}

type Regexp regexp.Regexp

func (r *Regexp) MarshalJSON() ([]byte, error) {
Expand Down

0 comments on commit c842d75

Please # to comment.