Skip to content

Commit

Permalink
Missed a brace in merge...
Browse files Browse the repository at this point in the history
  • Loading branch information
Benjamin Howarth committed Jun 5, 2019
1 parent 2b790cf commit ce52764
Showing 1 changed file with 24 additions and 24 deletions.
48 changes: 24 additions & 24 deletions Refit/RestMethodInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,35 +171,35 @@ Dictionary<int, Tuple<string, ParameterType>> BuildParameterMap(string relativeP
{
var paramValidationDict = parameterInfo.ToDictionary(k => GetUrlNameForParameter(k).ToLowerInvariant(), v => v);

foreach (var match in parameterizedParts)
{
var rawName = match.Groups[1].Value.ToLowerInvariant();
var isRoundTripping = rawName.StartsWith("**");
string name;
if (isRoundTripping)
{
name = rawName.Substring(2);
}
else
foreach (var match in parameterizedParts)
{
name = rawName;
}
var rawName = match.Groups[1].Value.ToLowerInvariant();
var isRoundTripping = rawName.StartsWith("**");
string name;
if (isRoundTripping)
{
name = rawName.Substring(2);
}
else
{
name = rawName;
}

if (!paramValidationDict.ContainsKey(name))
{
throw new ArgumentException($"URL {relativePath} has parameter {rawName}, but no method parameter matches");
}
if (!paramValidationDict.ContainsKey(name))
{
throw new ArgumentException($"URL {relativePath} has parameter {rawName}, but no method parameter matches");
}

var paramType = paramValidationDict[name].ParameterType;
if (isRoundTripping && paramType != typeof(string))
{
throw new ArgumentException($"URL {relativePath} has round-tripping parameter {rawName}, but the type of matched method parameter is {paramType.FullName}. It must be a string.");
}
var paramType = paramValidationDict[name].ParameterType;
if (isRoundTripping && paramType != typeof(string))
{
throw new ArgumentException($"URL {relativePath} has round-tripping parameter {rawName}, but the type of matched method parameter is {paramType.FullName}. It must be a string.");
}

var parameterType = isRoundTripping ? ParameterType.RoundTripping : ParameterType.Normal;
ret.Add(parameterInfo.IndexOf(paramValidationDict[name]), Tuple.Create(name, parameterType));
var parameterType = isRoundTripping ? ParameterType.RoundTripping : ParameterType.Normal;
ret.Add(parameterInfo.IndexOf(paramValidationDict[name]), Tuple.Create(name, parameterType));
}
}

return ret;
}

Expand Down

0 comments on commit ce52764

Please sign in to comment.