diff --git a/example/shirtsize_jsonenums.go b/example/shirtsize_jsonenums.go index af60b7e..d50c71a 100644 --- a/example/shirtsize_jsonenums.go +++ b/example/shirtsize_jsonenums.go @@ -41,6 +41,7 @@ func init() { } } +// MarshalJSON is generated so ShirtSize satisfies json.Marshaler. func (r ShirtSize) MarshalJSON() ([]byte, error) { if s, ok := interface{}(r).(fmt.Stringer); ok { return json.Marshal(s.String()) @@ -52,6 +53,7 @@ func (r ShirtSize) MarshalJSON() ([]byte, error) { return json.Marshal(s) } +// UnmarshalJSON is generated so ShirtSize satisfies json.Unmarshaler. func (r *ShirtSize) UnmarshalJSON(data []byte) error { var s string if err := json.Unmarshal(data, &s); err != nil { diff --git a/example/weekday_jsonenums.go b/example/weekday_jsonenums.go index c24d250..a97dd11 100644 --- a/example/weekday_jsonenums.go +++ b/example/weekday_jsonenums.go @@ -44,6 +44,7 @@ func init() { } } +// MarshalJSON is generated so WeekDay satisfies json.Marshaler. func (r WeekDay) MarshalJSON() ([]byte, error) { if s, ok := interface{}(r).(fmt.Stringer); ok { return json.Marshal(s.String()) @@ -55,6 +56,7 @@ func (r WeekDay) MarshalJSON() ([]byte, error) { return json.Marshal(s) } +// UnmarshalJSON is generated so WeekDay satisfies json.Unmarshaler. func (r *WeekDay) UnmarshalJSON(data []byte) error { var s string if err := json.Unmarshal(data, &s); err != nil {