0.2.0 #10

Manually merged
xdrm-brackets merged 43 commits from 0.2.0 into master 2020-03-08 15:28:42 +00:00
2 changed files with 4 additions and 10 deletions
Showing only changes of commit 638f5e44c8 - Show all commits

View File

@ -490,7 +490,9 @@ func TestParseParameters(t *testing.T) {
if err != nil && test.Error != nil { if err != nil && test.Error != nil {
if err.Error() != test.Error.Error() && err.Error() != test.ErrorAlternative.Error() { if err.Error() != test.Error.Error() && err.Error() != test.ErrorAlternative.Error() {
t.Errorf("expected the error '%s' (got '%s')", test.Error.Error(), err.Error()) t.Errorf("got the error: '%s'", err.Error())
t.Errorf("expected error (alternative 1): '%s'", test.Error.Error())
t.Errorf("expected error (alternative 2): '%s'", test.ErrorAlternative.Error())
t.FailNow() t.FailNow()
} }
} }

View File

@ -39,17 +39,9 @@ func (methodDef *Method) checkAndFormat(servicePath string, httpMethod string) e
} }
// 3.2.1. Same rename field // 3.2.1. Same rename field
if pData.Rename == param.Rename {
return ErrParamNameConflict.WrapString(httpMethod + " " + servicePath + " {" + pName + "}")
}
// 3.2.2. Not-renamed field matches a renamed field // 3.2.2. Not-renamed field matches a renamed field
if pName == param.Rename {
return ErrParamNameConflict.WrapString(httpMethod + " " + servicePath + " {" + pName + "}")
}
// 3.2.3. Renamed field matches name // 3.2.3. Renamed field matches name
if pData.Rename == paramName { if pData.Rename == param.Rename || pName == param.Rename || pData.Rename == paramName {
return ErrParamNameConflict.WrapString(httpMethod + " " + servicePath + " {" + pName + "}") return ErrParamNameConflict.WrapString(httpMethod + " " + servicePath + " {" + pName + "}")
} }