Skip to content
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

Mark StringContent mediaType parameters as nullable #103442

Merged
merged 2 commits into from
Jun 14, 2024

Conversation

MihaZupan
Copy link
Member

Closes #83423

This PR doesn't change the behavior of MediaTypeHeaderValue? mediaType overloads where null currently means "no media type".
If we decide that's something we want to do, we can do so as a follow-up.

We have existing tests covering passing null to these consturctors.

@MihaZupan MihaZupan added this to the 9.0.0 milestone Jun 13, 2024
@MihaZupan MihaZupan requested a review from a team June 13, 2024 19:44
@MihaZupan MihaZupan self-assigned this Jun 13, 2024
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

1 similar comment
Copy link

Note regarding the new-api-needs-documentation label:

This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change.

Copy link
Member

@wfurt wfurt left a comment

Choose a reason for hiding this comment

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

lgtm

@campersau
Copy link
Contributor

The ! could now be removed from here right?

var content = new StringContent(sourceString, defaultStringEncoding, ((Headers.MediaTypeHeaderValue)null)!);

@MihaZupan MihaZupan merged commit 4a87c0e into dotnet:main Jun 14, 2024
81 of 83 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revert unintentional nullability changes and fix inconsistencies in StringContent ctrs
4 participants