Merge pull request #3460 from neilotoole/issue-3459_bad_required_checking

Issue #3459 removed check for required params
This commit is contained in:
wing328 2016-07-27 16:18:49 +08:00 committed by GitHub
commit 0675f1686e

View File

@ -45,11 +45,7 @@ func (a {{{classname}}}) {{{nickname}}}({{#allParams}}{{paramName}} {{{dataType}
// create path and map variables // create path and map variables
path := a.Configuration.BasePath + "{{path}}"{{#pathParams}} path := a.Configuration.BasePath + "{{path}}"{{#pathParams}}
path = strings.Replace(path, "{"+"{{baseName}}"+"}", fmt.Sprintf("%v", {{paramName}}), -1){{/pathParams}} path = strings.Replace(path, "{"+"{{baseName}}"+"}", fmt.Sprintf("%v", {{paramName}}), -1){{/pathParams}}
{{#allParams}}{{#required}}
// verify the required parameter '{{paramName}}' is set
if &{{paramName}} == nil {
return {{#returnType}}{{#isListContainer}}*{{/isListContainer}}new({{{returnType}}}), {{/returnType}}nil, errors.New("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}")
}{{/required}}{{/allParams}}
headerParams := make(map[string]string) headerParams := make(map[string]string)
queryParams := url.Values{} queryParams := url.Values{}