-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Add MediaTypeNames.Application.Yaml #117211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Alphabet fail.
There was a problem hiding this 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
Yamlconstant 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";
|
Tagging subscribers to this area: @dotnet/ncl |
| 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"; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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).
stephentoub
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
Resolves #105809.