Omit null mimeType from ResourceContents JSON serialization (#1325)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stephentoub <2642209+stephentoub@users.noreply.github.com> Co-authored-by: Stephen Toub <stoub@microsoft.com>
This commit is contained in:
parent
54283a8590
commit
3727dc4aaa
1 changed files with 34 additions and 1 deletions
|
|
@ -158,7 +158,10 @@ public abstract class ResourceContents
|
|||
|
||||
writer.WriteStartObject();
|
||||
writer.WriteString("uri", value.Uri);
|
||||
writer.WriteString("mimeType", value.MimeType);
|
||||
if (value.MimeType is not null)
|
||||
{
|
||||
writer.WriteString("mimeType", value.MimeType);
|
||||
}
|
||||
|
||||
Debug.Assert(value is BlobResourceContents or TextResourceContents);
|
||||
if (value is BlobResourceContents blobResource)
|
||||
|
|
|
|||
Loading…
Reference in a new issue