Skip to content

Commit

Permalink
fix: axios generator 生成方法参数顺序
Browse files Browse the repository at this point in the history
  • Loading branch information
link-duan committed Feb 20, 2023
1 parent 3a6864c commit 1ec87b2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions generators/axios/axios.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,6 @@ func (p *Printer) request(path string, method string, item *spec.Operation) f.Do
if len(queryParams) > 0 {
params = append(params, f.Group(f.Content("query: "), p.paramsType(queryParams)))
}
params = append(params, f.Content("config?: AxiosRequestConfig"))

if item.RequestBody != nil {
_, mediaType := p.getRequestMediaType(item)
if mediaType != nil {
Expand All @@ -172,6 +170,7 @@ func (p *Printer) request(path string, method string, item *spec.Operation) f.Do
}
}
}
params = append(params, f.Content("config?: AxiosRequestConfig"))

functionBody := p.requestFunctionBody(pathName, method, queryParams, item)
return f.Group(
Expand Down

0 comments on commit 1ec87b2

Please sign in to comment.