Skip to content

Conversation

@martincostello
Copy link
Member

Resolves #105809.

Copilot AI review requested due to automatic review settings July 1, 2025 17:55
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jul 1, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds a new Yaml media type constant to MediaTypeNames.Application for YAML support.

  • Defines public const string Yaml = "application/yaml"; in the implementation.
  • Mirrors the addition in the reference (ref) assembly.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/libraries/System.Net.Mail/src/System/Net/Mime/MediaTypeNames.cs Added Yaml constant with XML doc comment
src/libraries/System.Net.Mail/ref/System.Net.Mail.cs Added Yaml constant to the public reference API
Comments suppressed due to low confidence (2)

src/libraries/System.Net.Mail/src/System/Net/Mime/MediaTypeNames.cs:60

  • Consider adding a unit test that asserts the Yaml constant equals the expected media type string to catch any future regressions.
            public const string Yaml = "application/yaml";

src/libraries/System.Net.Mail/src/System/Net/Mime/MediaTypeNames.cs:60

  • Verify that "application/yaml" is the correct IANA-registered media type, as "application/x-yaml" is also commonly used.
            public const string Yaml = "application/yaml";

@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

public const string Xml = "application/xml";
public const string XmlDtd = "application/xml-dtd";
public const string XmlPatch = "application/xml-patch+xml";
public const string Yaml = "application/yaml";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MihaZupan, separately, should we be looking to type forward MediaTypeNames down into System.Net.Primitives or somewhere other than System.Net.Mail?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than Mail being a weird place for it and it being elsewhere making more sense for source organization, it wouldn't have any practical implications on e.g. end-user apps, right?

Copy link
Member

@stephentoub stephentoub Jul 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With System.Net.Mail being in the shared framework, and with the only things on this type being constants such that references to it evaporate at build time, I don't think there's any meaningful implication for a consuming app (unless it were to programmatically look at typeof(MediaTypeNames).Assembly).

Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@MihaZupan MihaZupan added this to the 10.0.0 milestone Jul 1, 2025
@MihaZupan MihaZupan enabled auto-merge (squash) July 1, 2025 18:37
@MihaZupan MihaZupan merged commit 6f34abd into dotnet:main Jul 1, 2025
85 of 89 checks passed
@martincostello martincostello deleted the gh-105809 branch July 1, 2025 20:51
@github-actions github-actions bot locked and limited conversation to collaborators Aug 1, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Net community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Add MediaTypeNames.Application.Yaml

3 participants