Skip to content

Conversation

@maxkoshevoi
Copy link
Contributor

@maxkoshevoi maxkoshevoi commented Aug 14, 2021

@ghost ghost added community-contribution Indicates that the PR has been added by a community member area-Extensions-Configuration labels Aug 14, 2021
@ghost
Copy link

ghost commented Aug 14, 2021

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, to 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.

@ghost
Copy link

ghost commented Aug 14, 2021

Tagging subscribers to this area: @maryamariyan, @safern
See info in area-owners.md if you want to be subscribed.

Issue Details

Related to #43605, #54012

Author: maxkoshevoi
Assignees: -
Labels:

new-api-needs-documentation, area-Extensions-Configuration, community-contribution

Milestone: -

@maryamariyan
Copy link
Contributor

Thanks for the PRs @maxkoshevoi, the nullable annotations effort for Microsoft.Extensions.* is targeted for 7.0, and since this week we're focusing on 6.0 bugs, there might be some delays with the reviews.

@maryamariyan maryamariyan added this to the 7.0.0 milestone Aug 16, 2021
@maxkoshevoi
Copy link
Contributor Author

I hoped, at least Configuration.Abstractions can still make it into 6.0.. Got it, thanks.

# Conflicts:
#	src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/ConfigurationExtensions.cs
# Conflicts:
#	src/libraries/Microsoft.Extensions.Configuration.Abstractions/ref/Microsoft.Extensions.Configuration.Abstractions.csproj
#	src/libraries/Microsoft.Extensions.Configuration.Abstractions/src/Microsoft.Extensions.Configuration.Abstractions.csproj
/// <param name="path">The path.</param>
/// <returns>The original path minus the last individual segment found in it. Null if the original path corresponds to a top level node.</returns>
public static string GetParentPath(string path)
public static string? GetParentPath(string? path)
Copy link
Member

Choose a reason for hiding this comment

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

honestly I think path should be marked as non-null the doc suggests it should be a path also it's not intuitive what will happen when it's null. I do not feel strongly about this so fine with me if you think we should keep it as is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I also don't have a strong opinion. One benefit of making path nullable is that user don't need additional null-check in order to call this method (if their variable may be null).

I didn't find any calls to this method here or in aspnet, so don't know how this method it used.

/// Gets or sets the section value.
/// </summary>
string Value { get; set; }
string? Value { get; set; }
Copy link
Member

Choose a reason for hiding this comment

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

if you decide to keep path as nullable arg in other places should this also accept nullable path?

Copy link
Contributor Author

@maxkoshevoi maxkoshevoi Sep 16, 2021

Choose a reason for hiding this comment

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

Copy link
Member

@eerhardt eerhardt left a comment

Choose a reason for hiding this comment

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

I think these changes look good. Thanks @maxkoshevoi.

@eerhardt eerhardt merged commit 1f555b2 into dotnet:main Oct 6, 2021
@maxkoshevoi maxkoshevoi deleted the mk/43605-Configuration-Abstractions branch October 6, 2021 21:27
@ghost ghost locked as resolved and limited conversation to collaborators Nov 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Extensions-Configuration community-contribution Indicates that the PR has been added by a community member new-api-needs-documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants