Skip to content

Improve documentation RequestHeaders and ResponseHeaders #14971

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

Merged
merged 2 commits into from
Oct 16, 2019

Conversation

koenekelschot
Copy link
Contributor

Summary of the changes (Less than 80 chars)

  • Added xmldocs

Addresses #3465

@dnfclas
Copy link

dnfclas commented Oct 13, 2019

CLA assistant check
All CLA requirements met.

@jkotalik
Copy link
Contributor

@anurse your favorite kind of PR 😄.

/// <typeparam name="T">The type of the header.
/// The given type must have a static TryParse method</typeparam>
/// <param name="name">The name of the header to retrieve.</param>
/// <returns>The value of the header</returns>
Copy link
Contributor

Choose a reason for hiding this comment

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

As a follow-up, we should either make another PR or add to this PR to add xml documentation for the rest of these properties.

Also, isn't there an analyzer that we can enable to check for all public apis that don't have xml docs?

Copy link
Contributor

Choose a reason for hiding this comment

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

One small nit:

Suggested change
/// <returns>The value of the header</returns>
/// <returns>The value of the header.</returns>

Also, isn't there an analyzer that we can enable to check for all public apis that don't have xml docs?

It's even better than that :). If we turn the right settings on we get a build warning (or error if we promote it to that). Some projects are using that now. We need to get "clean" before we can turn that on more broadly though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jkotalik and @anurse thanks for the comments! They should be resolved in the latest commit.

Regarding the other properties in these classes, I'm willing to document them as well, but do add those docs to this PR or do I open a new PR?

@analogrelay analogrelay added this to the 5.0.0-preview1 milestone Oct 14, 2019
Copy link
Contributor

@analogrelay analogrelay left a comment

Choose a reason for hiding this comment

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

Generally looks good! Let's make all the methods consistent in how the docs are formatted. Once we've got that, I think we'll be good to go.

/// <typeparam name="T">The type of the header.
/// The given type must have a static TryParse method</typeparam>
/// <param name="name">The name of the header to retrieve.</param>
/// <returns>The value of the header</returns>
Copy link
Contributor

Choose a reason for hiding this comment

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

One small nit:

Suggested change
/// <returns>The value of the header</returns>
/// <returns>The value of the header.</returns>

Also, isn't there an analyzer that we can enable to check for all public apis that don't have xml docs?

It's even better than that :). If we turn the right settings on we get a build warning (or error if we promote it to that). Some projects are using that now. We need to get "clean" before we can turn that on more broadly though.

/// <typeparam name="T">The type of the header.
/// The given type must have a static TryParseList method</typeparam>
/// <param name="name">The name of the header to retrieve.</param>
/// <returns>List of values of the header</returns>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// <returns>List of values of the header</returns>
/// <returns>List of values of the header.</returns>

/// <summary>
/// Gets the values of header with <paramref name="name"/>.
/// </summary>
/// <remarks><typeparamref name="T"/> must contain a TryParseList method with the signature <code>public static bool TryParseList(IList&lt;string&gt;, out IList&lt;T&gt;)</code></remarks>
Copy link
Contributor

Choose a reason for hiding this comment

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

You used typeparamref here but not in the Get method. I'm fine with doing this either way but we should be consistent.

Similarly, you put the full signature in here, but not above.

Copy link
Contributor

Choose a reason for hiding this comment

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

We should also be consistent between remarks and typeparam items. Let's make them similar in format and consistent between both methods.

/// <summary>
/// Gets the values of header with <paramref name="name"/>.
/// </summary>
/// <remarks><typeparamref name="T"/> must contain a TryParseList method with the signature <code>public static bool TryParseList(IList&lt;string&gt;, out IList&lt;T&gt;)</code></remarks>
Copy link
Contributor

Choose a reason for hiding this comment

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

Same comments about consistency apply here.

@Tratcher
Copy link
Member

@aspnet-hello
Copy link

This comment was made automatically. If there is a problem contact [email protected].

I've triaged the above build. I've created/commented on the following issue(s)
https://github.com/aspnet/AspNetCore-Internal/issues/3241
https://github.com/aspnet/AspNetCore-Internal/issues/3128
https://github.com/aspnet/AspNetCore-Internal/issues/3173

@Tratcher
Copy link
Member

@Tratcher
Copy link
Member

@HaoK Build Tests: Helix x64 still looks too flaky to be required.

@HaoK
Copy link
Member

HaoK commented Oct 15, 2019

Looks like there might be something going on with redis causing these tests to fail:

   System.AggregateException : One or more errors occurred. (Command '/usr/bin/docker run --rm -p 6379:6379 --name redisTestContainer -d redis' failed with exit code '125'. Output:
Unable to find image 'redis:latest' locally
/usr/bin/docker: Error response from daemon: received unexpected HTTP status: 503 Service Unavailable.
See '/usr/bin/docker run --help'.

@Tratcher Tratcher merged commit 1599a5a into dotnet:master Oct 16, 2019
@Tratcher
Copy link
Member

Thanks

@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants