Skip to content

Commit

Permalink
allow examples for objects
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidfm committed Jul 20, 2022
1 parent f3ff9ec commit 7f5aab2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,13 @@ func (t *Schema) parseValue(val string) (parsed interface{}, ok bool) {
}
return parsed, true

case "", "object":
obj := make(map[string]interface{})
if err := json.Unmarshal([]byte(val), &obj); err != nil {
return nil, false
}
return obj, true

default:
return nil, false
}
Expand Down

0 comments on commit 7f5aab2

Please sign in to comment.