Skip to content

Commit

Permalink
Merge pull request #100 from alena1108/feb26
Browse files Browse the repository at this point in the history
Translate field to annotation only when not nil
  • Loading branch information
Alena Prokharchyk authored Feb 26, 2018
2 parents 2399924 + 50be08f commit 5bce948
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion types/mapper/annotation_field.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (e AnnotationField) FromInternal(data map[string]interface{}) {

func (e AnnotationField) ToInternal(data map[string]interface{}) {
v, ok := data[e.Field]
if ok {
if ok && v != nil {
if e.Object || e.List {
if bytes, err := json.Marshal(v); err == nil {
v = string(bytes)
Expand Down

0 comments on commit 5bce948

Please sign in to comment.