From 98bce85cacc8a17a6f6b0d96df3ae2c1d07f5b13 Mon Sep 17 00:00:00 2001 From: Alex Villarreal Date: Fri, 27 Apr 2018 19:34:25 -0500 Subject: Improve documentation to use Metadata.Entry Add notes about the parameters in public constructors of `Metadata.Entry`, and `Metadata`s `Add` methods (which call the aforementioned constructors), to clearly indicate what a valid key should be, **and the fact that it is converted to lowercase**. Seems like an important enough side effect that it should be explicit in the documentation. --- src/csharp/Grpc.Core/Metadata.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/csharp') diff --git a/src/csharp/Grpc.Core/Metadata.cs b/src/csharp/Grpc.Core/Metadata.cs index a9aa2cbbfc..b59aee7d80 100644 --- a/src/csharp/Grpc.Core/Metadata.cs +++ b/src/csharp/Grpc.Core/Metadata.cs @@ -137,6 +137,8 @@ namespace Grpc.Core /// /// /// + /// Metadata key. Gets converted to lowercase. Must not use suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores and hyphens. + /// Value string. Only ASCII characters are allowed. public void Add(string key, string value) { Add(new Entry(key, value)); @@ -145,6 +147,8 @@ namespace Grpc.Core /// /// /// + /// Metadata key. Gets converted to lowercase. Needs to have suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores and hyphens. + /// Value bytes. public void Add(string key, byte[] valueBytes) { Add(new Entry(key, valueBytes)); @@ -239,7 +243,7 @@ namespace Grpc.Core /// /// Initializes a new instance of the struct with a binary value. /// - /// Metadata key, needs to have suffix indicating a binary valued metadata entry. + /// Metadata key. Gets converted to lowercase. Needs to have suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores and hyphens. /// Value bytes. public Entry(string key, byte[] valueBytes) { @@ -255,7 +259,7 @@ namespace Grpc.Core /// /// Initializes a new instance of the struct holding an ASCII value. /// - /// Metadata key, must not use suffix indicating a binary valued metadata entry. + /// Metadata key. Gets converted to lowercase. Must not use suffix indicating a binary valued metadata entry. Can only contain lowercase alphanumeric characters, underscores and hyphens. /// Value string. Only ASCII characters are allowed. public Entry(string key, string value) { -- cgit v1.2.3