forked from loafle/openapi-generator-original
fixed io/ioutil import issue, fixed param casing issue
This commit is contained in:
@@ -6,6 +6,15 @@ import (
|
||||
"fmt"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
{{#operation}}
|
||||
{{#hasFormParams}}
|
||||
{{#formParams}}
|
||||
{{#isFile}}
|
||||
"io/ioutil"
|
||||
{{/isFile}}
|
||||
{{/formParams}}
|
||||
{{/hasFormParams}}
|
||||
{{/operation}}
|
||||
{{#imports}} "{{import}}"
|
||||
{{/imports}}
|
||||
)
|
||||
@@ -90,7 +99,7 @@ func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{
|
||||
|
||||
{{#hasQueryParams}}
|
||||
{{#queryParams}}
|
||||
queryParams["{{vendorExtensions.x-exportParamName}}"] = a.Configuration.ApiClient.ParameterToString({{paramName}})
|
||||
queryParams["{{paramName}}"] = a.Configuration.ApiClient.ParameterToString({{paramName}})
|
||||
{{/queryParams}}
|
||||
{{/hasQueryParams}}
|
||||
|
||||
@@ -124,7 +133,7 @@ func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{
|
||||
{{#isFile}}fileBytes, _ := ioutil.ReadAll(file)
|
||||
postBody = fileBytes
|
||||
{{/isFile}}
|
||||
{{^isFile}}formParams["{{vendorExtensions.x-exportParamName}}"] = {{paramName}}
|
||||
{{^isFile}}formParams["{{paramName}}"] = {{paramName}}
|
||||
{{/isFile}}
|
||||
{{/formParams}}
|
||||
{{/hasFormParams}}{{#hasBodyParam}}{{#bodyParams}} // body params
|
||||
|
||||
@@ -5,8 +5,8 @@ import (
|
||||
"fmt"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"os"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
)
|
||||
|
||||
type PetApi struct {
|
||||
@@ -201,7 +201,7 @@ func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error, ApiResponse) {
|
||||
headerParams[key] = a.Configuration.DefaultHeader[key]
|
||||
}
|
||||
|
||||
queryParams["Status"] = a.Configuration.ApiClient.ParameterToString(status)
|
||||
queryParams["status"] = a.Configuration.ApiClient.ParameterToString(status)
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string {
|
||||
@@ -269,7 +269,7 @@ func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error, ApiResponse) {
|
||||
headerParams[key] = a.Configuration.DefaultHeader[key]
|
||||
}
|
||||
|
||||
queryParams["Tags"] = a.Configuration.ApiClient.ParameterToString(tags)
|
||||
queryParams["tags"] = a.Configuration.ApiClient.ParameterToString(tags)
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string {
|
||||
@@ -497,8 +497,8 @@ func (a PetApi) UpdatePetWithForm (petId int64, name string, status string) (err
|
||||
headerParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
|
||||
formParams["Name"] = name
|
||||
formParams["Status"] = status
|
||||
formParams["name"] = name
|
||||
formParams["status"] = status
|
||||
|
||||
|
||||
httpResponse, err := a.Configuration.ApiClient.CallApi(path, httpMethod, postBody, headerParams, queryParams, formParams)
|
||||
@@ -567,7 +567,7 @@ func (a PetApi) UploadFile (petId int64, additionalMetadata string, file *os.Fil
|
||||
headerParams["Accept"] = localVarHttpHeaderAccept
|
||||
}
|
||||
|
||||
formParams["AdditionalMetadata"] = additionalMetadata
|
||||
formParams["additionalMetadata"] = additionalMetadata
|
||||
fileBytes, _ := ioutil.ReadAll(file)
|
||||
postBody = fileBytes
|
||||
|
||||
|
||||
@@ -365,8 +365,8 @@ func (a UserApi) LoginUser (username string, password string) (string, error, Ap
|
||||
headerParams[key] = a.Configuration.DefaultHeader[key]
|
||||
}
|
||||
|
||||
queryParams["Username"] = a.Configuration.ApiClient.ParameterToString(username)
|
||||
queryParams["Password"] = a.Configuration.ApiClient.ParameterToString(password)
|
||||
queryParams["username"] = a.Configuration.ApiClient.ParameterToString(username)
|
||||
queryParams["password"] = a.Configuration.ApiClient.ParameterToString(password)
|
||||
|
||||
// to determine the Content-Type header
|
||||
localVarHttpContentTypes := []string {
|
||||
|
||||
Reference in New Issue
Block a user