Skip to content

Commit

Permalink
handle maps in root objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Misfits09 authored and schmurfy committed Mar 13, 2024
1 parent c659846 commit 5f963dd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion wrapper/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ func convertValue(fieldType reflect.Type, value string) (reflect.Value, error) {
setValuePtr := reflect.New(fieldType)
setValuePtr.Elem().Set(setValue)
return setValuePtr, nil

case reflect.Map:
outMapPtr := reflect.New(fieldType)
err := json.Unmarshal([]byte(value), outMapPtr.Interface())
if err != nil {
return _noValue, err
}
return outMapPtr.Elem(), nil
case reflect.Slice:
param := strings.Split(
strings.Trim(value, `[]`),
Expand Down

0 comments on commit 5f963dd

Please sign in to comment.