Skip to content

Commit

Permalink
add JsonConverter to handle fields being a single or array instance. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mjharwood authored Oct 31, 2024
1 parent 7c9c0f5 commit 548c35b
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ public class Content
public string Type { get; set; }

[DataMember(Name = "media", EmitDefaultValue = false)]
[JsonConverter(typeof(SingleOrArrayConverter<Medium>))]
public IList<Medium> Media { get; set; }

[DataMember(Name = "colors", EmitDefaultValue = false)]
Expand Down Expand Up @@ -389,6 +390,7 @@ public class Content
public Metadata Metadata { get; set; }

[DataMember(Name = "attribution", EmitDefaultValue = false)]
[JsonConverter(typeof(SingleOrArrayConverter<Attribution>))]
public Attribution Attribution { get; set; }
}

Expand Down

0 comments on commit 548c35b

Please sign in to comment.