Skip to content

Commit

Permalink
Fix package name (#38)
Browse files Browse the repository at this point in the history
Co-authored-by: Henrique Santos <[email protected]>
  • Loading branch information
hcsa73 and Henrique Santos authored Oct 26, 2023
1 parent b16bd46 commit 8c06a11
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions templates/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net/http"
"net/url"
"{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/core/config"
oapiError "{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/core/oapierror"
"{{gitHost}}/{{gitUserId}}/{{gitRepoId}}/core/oapierror"
{{#imports}} "{{import}}"
{{/imports}}
)
Expand Down Expand Up @@ -90,7 +90,7 @@ func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/s
a := r.apiService
localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "{{{classname}}}Service.{{{nickname}}}")
if err != nil {
return {{#returnType}}localVarReturnValue, {{/returnType}} &oapiError.GenericOpenAPIError{ErrorMessage: err.Error()}
return {{#returnType}}localVarReturnValue, {{/returnType}} &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()}
}

localVarPath := localBasePath + "{{{path}}}"{{#pathParams}}
Expand Down Expand Up @@ -320,7 +320,7 @@ func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/s
}

if localVarHTTPResponse.StatusCode >= 300 {
newErr := &oapiError.GenericOpenAPIError{
newErr := &oapierror.GenericOpenAPIError{
StatusCode: localVarHTTPResponse.StatusCode,
Body: localVarBody,
ErrorMessage: localVarHTTPResponse.Status,
Expand Down Expand Up @@ -351,7 +351,7 @@ func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/s
newErr.ErrorMessage = err.Error()
return {{#returnType}}localVarReturnValue, {{/returnType}} newErr
}
newErr.ErrorMessage = oapiError.FormatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v)
newErr.Model = v
{{^-last}}
return {{#returnType}}localVarReturnValue, {{/returnType}} newErr
Expand All @@ -369,7 +369,7 @@ func (r {{#structPrefix}}{{&classname}}{{/structPrefix}}{{^structPrefix}}Api{{/s
{{#returnType}}
err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type"))
if err != nil {
newErr := &oapiError.GenericOpenAPIError{
newErr := &oapierror.GenericOpenAPIError{
StatusCode: localVarHTTPResponse.StatusCode,
Body: localVarBody,
ErrorMessage: err.Error(),
Expand Down

0 comments on commit 8c06a11

Please sign in to comment.