forked from loafle/openapi-generator-original
Merge branch 'bug' of https://github.com/guohuang/swagger-codegen into guohuang-bug
This commit is contained in:
commit
9257c94985
@ -39,7 +39,14 @@ func New{{classname}}WithBasePath(basePath string) *{{classname}}{
|
|||||||
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
{{/allParams}} * @return {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}
|
||||||
*/
|
*/
|
||||||
func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
func (a {{classname}}) {{nickname}} ({{#allParams}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}error) {
|
||||||
|
{{#allParams}}
|
||||||
|
{{#required}}
|
||||||
|
// verify the required parameter '{{paramName}}' is set
|
||||||
|
if &{{paramName}} == nil {
|
||||||
|
return {{#returnType}}*new({{{returnType}}}), {{/returnType}}errors.New("Missing required parameter '{{paramName}}' when calling {{classname}}->{{operationId}}")
|
||||||
|
}
|
||||||
|
{{/required}}
|
||||||
|
{{/allParams}}
|
||||||
_sling := sling.New().{{httpMethod}}(a.Configuration.BasePath)
|
_sling := sling.New().{{httpMethod}}(a.Configuration.BasePath)
|
||||||
|
|
||||||
{{#authMethods}}// authentication ({{name}}) required
|
{{#authMethods}}// authentication ({{name}}) required
|
||||||
|
@ -36,7 +36,10 @@ func NewPetApiWithBasePath(basePath string) *PetApi{
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a PetApi) AddPet (body Pet) (error) {
|
func (a PetApi) AddPet (body Pet) (error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling PetApi->AddPet")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -124,7 +127,10 @@ func (a PetApi) AddPet (body Pet) (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a PetApi) DeletePet (petId int64, apiKey string) (error) {
|
func (a PetApi) DeletePet (petId int64, apiKey string) (error) {
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if &petId == nil {
|
||||||
|
return errors.New("Missing required parameter 'petId' when calling PetApi->DeletePet")
|
||||||
|
}
|
||||||
_sling := sling.New().Delete(a.Configuration.BasePath)
|
_sling := sling.New().Delete(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -210,7 +216,10 @@ func (a PetApi) DeletePet (petId int64, apiKey string) (error) {
|
|||||||
* @return []Pet
|
* @return []Pet
|
||||||
*/
|
*/
|
||||||
func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
||||||
|
// verify the required parameter 'status' is set
|
||||||
|
if &status == nil {
|
||||||
|
return *new([]Pet), errors.New("Missing required parameter 'status' when calling PetApi->FindPetsByStatus")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -297,7 +306,10 @@ func (a PetApi) FindPetsByStatus (status []string) ([]Pet, error) {
|
|||||||
* @return []Pet
|
* @return []Pet
|
||||||
*/
|
*/
|
||||||
func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
||||||
|
// verify the required parameter 'tags' is set
|
||||||
|
if &tags == nil {
|
||||||
|
return *new([]Pet), errors.New("Missing required parameter 'tags' when calling PetApi->FindPetsByTags")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -384,7 +396,10 @@ func (a PetApi) FindPetsByTags (tags []string) ([]Pet, error) {
|
|||||||
* @return Pet
|
* @return Pet
|
||||||
*/
|
*/
|
||||||
func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if &petId == nil {
|
||||||
|
return *new(Pet), errors.New("Missing required parameter 'petId' when calling PetApi->GetPetById")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (api_key) required
|
// authentication (api_key) required
|
||||||
@ -467,7 +482,10 @@ func (a PetApi) GetPetById (petId int64) (Pet, error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a PetApi) UpdatePet (body Pet) (error) {
|
func (a PetApi) UpdatePet (body Pet) (error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling PetApi->UpdatePet")
|
||||||
|
}
|
||||||
_sling := sling.New().Put(a.Configuration.BasePath)
|
_sling := sling.New().Put(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -556,7 +574,10 @@ func (a PetApi) UpdatePet (body Pet) (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a PetApi) UpdatePetWithForm (petId int64, name string, status string) (error) {
|
func (a PetApi) UpdatePetWithForm (petId int64, name string, status string) (error) {
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if &petId == nil {
|
||||||
|
return errors.New("Missing required parameter 'petId' when calling PetApi->UpdatePetWithForm")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
@ -648,7 +669,10 @@ func (a PetApi) UpdatePetWithForm (petId int64, name string, status string) (err
|
|||||||
* @return ApiResponse
|
* @return ApiResponse
|
||||||
*/
|
*/
|
||||||
func (a PetApi) UploadFile (petId int64, additionalMetadata string, file *os.File) (ApiResponse, error) {
|
func (a PetApi) UploadFile (petId int64, additionalMetadata string, file *os.File) (ApiResponse, error) {
|
||||||
|
// verify the required parameter 'petId' is set
|
||||||
|
if &petId == nil {
|
||||||
|
return *new(ApiResponse), errors.New("Missing required parameter 'petId' when calling PetApi->UploadFile")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (petstore_auth) required
|
// authentication (petstore_auth) required
|
||||||
|
@ -35,7 +35,10 @@ func NewStoreApiWithBasePath(basePath string) *StoreApi{
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a StoreApi) DeleteOrder (orderId string) (error) {
|
func (a StoreApi) DeleteOrder (orderId string) (error) {
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if &orderId == nil {
|
||||||
|
return errors.New("Missing required parameter 'orderId' when calling StoreApi->DeleteOrder")
|
||||||
|
}
|
||||||
_sling := sling.New().Delete(a.Configuration.BasePath)
|
_sling := sling.New().Delete(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -112,7 +115,6 @@ func (a StoreApi) DeleteOrder (orderId string) (error) {
|
|||||||
* @return map[string]int32
|
* @return map[string]int32
|
||||||
*/
|
*/
|
||||||
func (a StoreApi) GetInventory () (map[string]int32, error) {
|
func (a StoreApi) GetInventory () (map[string]int32, error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
// authentication (api_key) required
|
// authentication (api_key) required
|
||||||
@ -193,7 +195,10 @@ func (a StoreApi) GetInventory () (map[string]int32, error) {
|
|||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
func (a StoreApi) GetOrderById (orderId int64) (Order, error) {
|
func (a StoreApi) GetOrderById (orderId int64) (Order, error) {
|
||||||
|
// verify the required parameter 'orderId' is set
|
||||||
|
if &orderId == nil {
|
||||||
|
return *new(Order), errors.New("Missing required parameter 'orderId' when calling StoreApi->GetOrderById")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -271,7 +276,10 @@ func (a StoreApi) GetOrderById (orderId int64) (Order, error) {
|
|||||||
* @return Order
|
* @return Order
|
||||||
*/
|
*/
|
||||||
func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
func (a StoreApi) PlaceOrder (body Order) (Order, error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return *new(Order), errors.New("Missing required parameter 'body' when calling StoreApi->PlaceOrder")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
|
@ -35,7 +35,10 @@ func NewUserApiWithBasePath(basePath string) *UserApi{
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) CreateUser (body User) (error) {
|
func (a UserApi) CreateUser (body User) (error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling UserApi->CreateUser")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -114,7 +117,10 @@ func (a UserApi) CreateUser (body User) (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithArrayInput")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -193,7 +199,10 @@ func (a UserApi) CreateUsersWithArrayInput (body []User) (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling UserApi->CreateUsersWithListInput")
|
||||||
|
}
|
||||||
_sling := sling.New().Post(a.Configuration.BasePath)
|
_sling := sling.New().Post(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -272,7 +281,10 @@ func (a UserApi) CreateUsersWithListInput (body []User) (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) DeleteUser (username string) (error) {
|
func (a UserApi) DeleteUser (username string) (error) {
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if &username == nil {
|
||||||
|
return errors.New("Missing required parameter 'username' when calling UserApi->DeleteUser")
|
||||||
|
}
|
||||||
_sling := sling.New().Delete(a.Configuration.BasePath)
|
_sling := sling.New().Delete(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -350,7 +362,10 @@ func (a UserApi) DeleteUser (username string) (error) {
|
|||||||
* @return User
|
* @return User
|
||||||
*/
|
*/
|
||||||
func (a UserApi) GetUserByName (username string) (User, error) {
|
func (a UserApi) GetUserByName (username string) (User, error) {
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if &username == nil {
|
||||||
|
return *new(User), errors.New("Missing required parameter 'username' when calling UserApi->GetUserByName")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -429,7 +444,14 @@ func (a UserApi) GetUserByName (username string) (User, error) {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
func (a UserApi) LoginUser (username string, password string) (string, error) {
|
func (a UserApi) LoginUser (username string, password string) (string, error) {
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if &username == nil {
|
||||||
|
return *new(string), errors.New("Missing required parameter 'username' when calling UserApi->LoginUser")
|
||||||
|
}
|
||||||
|
// verify the required parameter 'password' is set
|
||||||
|
if &password == nil {
|
||||||
|
return *new(string), errors.New("Missing required parameter 'password' when calling UserApi->LoginUser")
|
||||||
|
}
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -510,7 +532,6 @@ Password string `url:"password,omitempty"`
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) LogoutUser () (error) {
|
func (a UserApi) LogoutUser () (error) {
|
||||||
|
|
||||||
_sling := sling.New().Get(a.Configuration.BasePath)
|
_sling := sling.New().Get(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
@ -588,7 +609,14 @@ func (a UserApi) LogoutUser () (error) {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
func (a UserApi) UpdateUser (username string, body User) (error) {
|
func (a UserApi) UpdateUser (username string, body User) (error) {
|
||||||
|
// verify the required parameter 'username' is set
|
||||||
|
if &username == nil {
|
||||||
|
return errors.New("Missing required parameter 'username' when calling UserApi->UpdateUser")
|
||||||
|
}
|
||||||
|
// verify the required parameter 'body' is set
|
||||||
|
if &body == nil {
|
||||||
|
return errors.New("Missing required parameter 'body' when calling UserApi->UpdateUser")
|
||||||
|
}
|
||||||
_sling := sling.New().Put(a.Configuration.BasePath)
|
_sling := sling.New().Put(a.Configuration.BasePath)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user