forked from loafle/openapi-generator-original
Merge pull request #3460 from neilotoole/issue-3459_bad_required_checking
Issue #3459 removed check for required params
This commit is contained in:
commit
0675f1686e
@ -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{}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user