Skip to content

Commit

Permalink
Merge pull request #585 from MariusVolkhart/mv/docs
Browse files Browse the repository at this point in the history
Expand XMLDocs for QueryAttribute and CollectionFormat
  • Loading branch information
Oren Novotny committed Nov 29, 2018
2 parents c14b2c2 + f4d83d8 commit 4efa19c
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion Refit/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,8 @@ public AuthorizeAttribute(string scheme = "Bearer")
public enum CollectionFormat
{
/// <summary>
/// Values formatted wiht RefitSettings.UrlParameterFormatter
/// Values formatted with <see cref="RefitSettings.UrlParameterFormatter"/> or
/// <see cref="RefitSettings.FormUrlEncodedParameterFormatter"/>.
/// </summary>
RefitParameterFormatter,

Expand Down Expand Up @@ -257,7 +258,29 @@ public QueryAttribute(CollectionFormat collectionFormat)
CollectionFormat = collectionFormat;
}

/// <summary>
/// Used to customize the name of either the query parameter pair or of the form field when form encoding.
/// </summary>
/// <seealso cref="Prefix"/>
public string Delimiter { get; protected set; } = ".";

/// <summary>
/// Used to customize the name of the encoded value.
/// </summary>
/// <remarks>
/// Gets combined with <see cref="Delimiter"/> in the format <code>var name = $"{Prefix}{Delimiter}{originalFieldName}"</code>
/// where <c>originalFieldName</c> is the name of the object property or method parameter.
/// </remarks>
/// <example>
/// <code>
/// class Form
/// {
/// [Query("-", "dontlog")]
/// public string password { get; }
/// }
/// </code>
/// will result in the encoded form having a field named <c>dontlog-password</c>.
/// </example>
public string Prefix { get; protected set; }

public string Format { get; set; }
Expand Down

0 comments on commit 4efa19c

Please sign in to comment.