RicoSuter/NSwag
View on GitHubConsider using JSON convertion for path and query parameters
Open
#675 opened on Mar 14, 2017
help wantedproject: NSwag.SwaggerGeneration.WebApitype: bug
Description
When an enum value is passed in the path or query, the EnumMemberAttribute is ignored because the value is serialized with ToString().
public enum Operation
{
[EnumMember("set")]
Set,
[EnumMember("update")]
Update,
}
public enum Value
{
[EnumMember("one")]
First,
[EnumMember("two")]
Second,
}
public async Task DoAsync(Operation operation, Value value)
{
// path = {operation}
// value is a query parameter
}
Called with DoAsync(Operation.Set, Value.First) will result in the Set?First URL instead of set?one.
It would be great if the JSON serializer was used to serialize values to path and query.