Skip to content

Commit

Permalink
Added internal check
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredoconnell committed Nov 15, 2024
1 parent c2be3ed commit 62587e3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions schema/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ func (o *ObjectSchema) Unserialize(data any) (result any, err error) {
}

func (o *ObjectSchema) unserializeInlinedDataToMap(data any) (map[string]any, error) {
if len(o.Properties()) != 1 {
panic(fmt.Errorf("unserializeInlinedDataToMap called on ObjectSchema with %d"+
" properties; only 1 allowed", len(o.Properties())))
}
for fieldName, property := range o.Properties() {
unserializedProperty, err := property.Unserialize(data)
if err != nil {
Expand Down

0 comments on commit 62587e3

Please sign in to comment.