Issue #3687 silence resty logging [Go] (#3705)

* disabling resty logger

* #3687 updating go-petstore
This commit is contained in:
Neil O'Toole
2016-09-05 03:11:34 -06:00
committed by wing328
parent 730eda05d2
commit f751e50e2e
50 changed files with 1358 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import (
"reflect"
"strings"
"net/url"
"io/ioutil"
"github.com/go-resty/resty"
)
@@ -107,7 +108,7 @@ func (c *APIClient) prepareClient() *resty.Client {
if c.config.Timeout != nil {
rClient.SetTimeout(*c.config.Timeout)
}
rClient.SetLogger(ioutil.Discard)
return rClient
}

View File

@@ -0,0 +1,30 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type AdditionalPropertiesClass struct {
MapProperty map[string]string `json:"map_property,omitempty"`
MapOfMapProperty map[string]map[string]string `json:"map_of_map_property,omitempty"`
}

View File

@@ -0,0 +1,30 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type Animal struct {
ClassName string `json:"className,omitempty"`
Color string `json:"color,omitempty"`
}

View File

@@ -0,0 +1,26 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type AnimalFarm struct {
}

View File

@@ -29,6 +29,7 @@ import (
"reflect"
"strings"
"net/url"
"io/ioutil"
"github.com/go-resty/resty"
)
@@ -128,7 +129,7 @@ func (c *APIClient) prepareClient() *resty.Client {
if c.config.Timeout != nil {
rClient.SetTimeout(*c.config.Timeout)
}
rClient.SetLogger(ioutil.Discard)
return rClient
}

View File

@@ -0,0 +1,28 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type ArrayOfArrayOfNumberOnly struct {
ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"`
}

View File

@@ -0,0 +1,28 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type ArrayOfNumberOnly struct {
ArrayNumber []float32 `json:"ArrayNumber,omitempty"`
}

View File

@@ -0,0 +1,32 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type ArrayTest struct {
ArrayOfString []string `json:"array_of_string,omitempty"`
ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"`
ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty"`
}

View File

@@ -0,0 +1,32 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type Cat struct {
ClassName string `json:"className,omitempty"`
Color string `json:"color,omitempty"`
Declawed bool `json:"declawed,omitempty"`
}

View File

@@ -0,0 +1,28 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type Client struct {
Client string `json:"client,omitempty"`
}

View File

@@ -0,0 +1,11 @@
# AdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MapProperty** | **map[string]string** | | [optional] [default to null]
**MapOfMapProperty** | [**map[string]map[string]string**](map.md) | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# Animal
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | | [default to null]
**Color** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,9 @@
# AnimalFarm
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# ArrayOfArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayArrayNumber** | [**[][]float32**](array.md) | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# ArrayOfNumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayNumber** | **[]float32** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# ArrayTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ArrayOfString** | **[]string** | | [optional] [default to null]
**ArrayArrayOfInteger** | [**[][]int64**](array.md) | | [optional] [default to null]
**ArrayArrayOfModel** | [**[][]ReadOnlyFirst**](array.md) | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# Cat
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | | [default to null]
**Color** | **string** | | [optional] [default to null]
**Declawed** | **bool** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# Client
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Client** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# Dog
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**ClassName** | **string** | | [default to null]
**Color** | **string** | | [optional] [default to null]
**Breed** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# EnumArrays
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**JustSymbol** | **string** | | [optional] [default to null]
**ArrayEnum** | **[]string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,9 @@
# EnumClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# EnumTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**EnumString** | **string** | | [optional] [default to null]
**EnumInteger** | **int32** | | [optional] [default to null]
**EnumNumber** | **float64** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,113 @@
# \FakeApi
All URIs are relative to *http://petstore.swagger.io/v2*
Method | HTTP request | Description
------------- | ------------- | -------------
[**TestClientModel**](FakeApi.md#TestClientModel) | **Patch** /fake | To test \"client\" model
[**TestEndpointParameters**](FakeApi.md#TestEndpointParameters) | **Post** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
[**TestEnumParameters**](FakeApi.md#TestEnumParameters) | **Get** /fake | To test enum parameters
# **TestClientModel**
> Client TestClientModel($body)
To test \"client\" model
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**body** | [**Client**](Client.md)| client model |
### Return type
[**Client**](Client.md)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TestEndpointParameters**
> TestEndpointParameters($number, $double, $patternWithoutDelimiter, $byte_, $integer, $int32_, $int64_, $float, $string_, $binary, $date, $dateTime, $password)
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**number** | **float32**| None |
**double** | **float64**| None |
**patternWithoutDelimiter** | **string**| None |
**byte_** | **string**| None |
**integer** | **int32**| None | [optional]
**int32_** | **int32**| None | [optional]
**int64_** | **int64**| None | [optional]
**float** | **float32**| None | [optional]
**string_** | **string**| None | [optional]
**binary** | **string**| None | [optional]
**date** | **time.Time**| None | [optional]
**dateTime** | **time.Time**| None | [optional]
**password** | **string**| None | [optional]
### Return type
void (empty response body)
### Authorization
[http_basic_test](../README.md#http_basic_test)
### HTTP request headers
- **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8
- **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
# **TestEnumParameters**
> TestEnumParameters($enumFormStringArray, $enumFormString, $enumHeaderStringArray, $enumHeaderString, $enumQueryStringArray, $enumQueryString, $enumQueryInteger, $enumQueryDouble)
To test enum parameters
### Parameters
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**enumFormStringArray** | [**[]string**](string.md)| Form parameter enum test (string array) | [optional]
**enumFormString** | **string**| Form parameter enum test (string) | [optional] [default to -efg]
**enumHeaderStringArray** | [**[]string**](string.md)| Header parameter enum test (string array) | [optional]
**enumHeaderString** | **string**| Header parameter enum test (string) | [optional] [default to -efg]
**enumQueryStringArray** | [**[]string**](string.md)| Query parameter enum test (string array) | [optional]
**enumQueryString** | **string**| Query parameter enum test (string) | [optional] [default to -efg]
**enumQueryInteger** | **float32**| Query parameter enum test (double) | [optional]
**enumQueryDouble** | **float64**| Query parameter enum test (double) | [optional]
### Return type
void (empty response body)
### Authorization
No authorization required
### HTTP request headers
- **Content-Type**: application/json
- **Accept**: application/json
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)

View File

@@ -0,0 +1,22 @@
# FormatTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Integer** | **int32** | | [optional] [default to null]
**Int32_** | **int32** | | [optional] [default to null]
**Int64_** | **int64** | | [optional] [default to null]
**Number** | **float32** | | [default to null]
**Float** | **float32** | | [optional] [default to null]
**Double** | **float64** | | [optional] [default to null]
**String_** | **string** | | [optional] [default to null]
**Byte_** | **string** | | [default to null]
**Binary** | **string** | | [optional] [default to null]
**Date** | [**time.Time**](time.Time.md) | | [default to null]
**DateTime** | [**time.Time**](time.Time.md) | | [optional] [default to null]
**Uuid** | **string** | | [optional] [default to null]
**Password** | **string** | | [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# HasOnlyReadOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bar** | **string** | | [optional] [default to null]
**Foo** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# List
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Var123List** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# MapTest
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**MapMapOfString** | [**map[string]map[string]string**](map.md) | | [optional] [default to null]
**MapOfEnumString** | **map[string]string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,12 @@
# MixedPropertiesAndAdditionalPropertiesClass
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Uuid** | **string** | | [optional] [default to null]
**DateTime** | [**time.Time**](time.Time.md) | | [optional] [default to null]
**Map_** | [**map[string]Animal**](Animal.md) | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# Model200Response
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **int32** | | [optional] [default to null]
**Class** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# ModelReturn
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Return_** | **int32** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,13 @@
# Name
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Name** | **int32** | | [default to null]
**SnakeCase** | **int32** | | [optional] [default to null]
**Property** | **string** | | [optional] [default to null]
**Var123Number** | **int32** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# NumberOnly
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**JustNumber** | **float32** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,11 @@
# ReadOnlyFirst
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**Bar** | **string** | | [optional] [default to null]
**Baz** | **string** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,10 @@
# SpecialModelName
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**SpecialPropertyName** | **int64** | | [optional] [default to null]
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

View File

@@ -0,0 +1,32 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type Dog struct {
ClassName string `json:"className,omitempty"`
Color string `json:"color,omitempty"`
Breed string `json:"breed,omitempty"`
}

View File

@@ -0,0 +1,30 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type EnumArrays struct {
JustSymbol string `json:"just_symbol,omitempty"`
ArrayEnum []string `json:"array_enum,omitempty"`
}

View File

@@ -0,0 +1,26 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type EnumClass struct {
}

View File

@@ -0,0 +1,32 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type EnumTest struct {
EnumString string `json:"enum_string,omitempty"`
EnumInteger int32 `json:"enum_integer,omitempty"`
EnumNumber float64 `json:"enum_number,omitempty"`
}

View File

@@ -0,0 +1,266 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
import (
"net/url"
"time"
"encoding/json"
)
type FakeApi struct {
Configuration *Configuration
}
func NewFakeApi() *FakeApi {
configuration := NewConfiguration()
return &FakeApi{
Configuration: configuration,
}
}
func NewFakeApiWithBasePath(basePath string) *FakeApi {
configuration := NewConfiguration()
configuration.BasePath = basePath
return &FakeApi{
Configuration: configuration,
}
}
/**
* To test \"client\" model
*
* @param body client model
* @return *Client
*/
func (a FakeApi) TestClientModel(body Client) (*Client, *APIResponse, error) {
var localVarHttpMethod = "Patch"
// create path and map variables
localVarPath := a.Configuration.BasePath + "/fake"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := make(map[string]string)
var localVarPostBody interface{}
var localVarFileName string
var localVarFileBytes []byte
// add default headers if any
for key := range a.Configuration.DefaultHeader {
localVarHeaderParams[key] = a.Configuration.DefaultHeader[key]
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// body params
localVarPostBody = &body
var successPayload = new(Client)
localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return successPayload, NewAPIResponse(localVarHttpResponse.RawResponse), err
}
err = json.Unmarshal(localVarHttpResponse.Body(), &successPayload)
return successPayload, NewAPIResponse(localVarHttpResponse.RawResponse), err
}
/**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
*
* @param number None
* @param double None
* @param patternWithoutDelimiter None
* @param byte_ None
* @param integer None
* @param int32_ None
* @param int64_ None
* @param float None
* @param string_ None
* @param binary None
* @param date None
* @param dateTime None
* @param password None
* @return void
*/
func (a FakeApi) TestEndpointParameters(number float32, double float64, patternWithoutDelimiter string, byte_ string, integer int32, int32_ int32, int64_ int64, float float32, string_ string, binary string, date time.Time, dateTime time.Time, password string) (*APIResponse, error) {
var localVarHttpMethod = "Post"
// create path and map variables
localVarPath := a.Configuration.BasePath + "/fake"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := make(map[string]string)
var localVarPostBody interface{}
var localVarFileName string
var localVarFileBytes []byte
// authentication '(http_basic_test)' required
// http basic authentication required
if a.Configuration.UserName != "" || a.Configuration.Password != ""{
localVarHeaderParams["Authorization"] = "Basic " + a.Configuration.GetBasicAuthEncodedString()
}
// add default headers if any
for key := range a.Configuration.DefaultHeader {
localVarHeaderParams[key] = a.Configuration.DefaultHeader[key]
}
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/xml; charset=utf-8", "application/json; charset=utf-8", }
// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/xml; charset=utf-8",
"application/json; charset=utf-8",
}
// set Accept header
localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
localVarFormParams["integer"] = a.Configuration.APIClient.ParameterToString(integer, "")
localVarFormParams["int32_"] = a.Configuration.APIClient.ParameterToString(int32_, "")
localVarFormParams["int64_"] = a.Configuration.APIClient.ParameterToString(int64_, "")
localVarFormParams["number"] = a.Configuration.APIClient.ParameterToString(number, "")
localVarFormParams["float"] = a.Configuration.APIClient.ParameterToString(float, "")
localVarFormParams["double"] = a.Configuration.APIClient.ParameterToString(double, "")
localVarFormParams["string_"] = a.Configuration.APIClient.ParameterToString(string_, "")
localVarFormParams["patternWithoutDelimiter"] = a.Configuration.APIClient.ParameterToString(patternWithoutDelimiter, "")
localVarFormParams["byte_"] = a.Configuration.APIClient.ParameterToString(byte_, "")
localVarFormParams["binary"] = a.Configuration.APIClient.ParameterToString(binary, "")
localVarFormParams["date"] = a.Configuration.APIClient.ParameterToString(date, "")
localVarFormParams["dateTime"] = a.Configuration.APIClient.ParameterToString(dateTime, "")
localVarFormParams["password"] = a.Configuration.APIClient.ParameterToString(password, "")
localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return NewAPIResponse(localVarHttpResponse.RawResponse), err
}
return NewAPIResponse(localVarHttpResponse.RawResponse), err
}
/**
* To test enum parameters
*
* @param enumFormStringArray Form parameter enum test (string array)
* @param enumFormString Form parameter enum test (string)
* @param enumHeaderStringArray Header parameter enum test (string array)
* @param enumHeaderString Header parameter enum test (string)
* @param enumQueryStringArray Query parameter enum test (string array)
* @param enumQueryString Query parameter enum test (string)
* @param enumQueryInteger Query parameter enum test (double)
* @param enumQueryDouble Query parameter enum test (double)
* @return void
*/
func (a FakeApi) TestEnumParameters(enumFormStringArray []string, enumFormString string, enumHeaderStringArray []string, enumHeaderString string, enumQueryStringArray []string, enumQueryString string, enumQueryInteger float32, enumQueryDouble float64) (*APIResponse, error) {
var localVarHttpMethod = "Get"
// create path and map variables
localVarPath := a.Configuration.BasePath + "/fake"
localVarHeaderParams := make(map[string]string)
localVarQueryParams := url.Values{}
localVarFormParams := make(map[string]string)
var localVarPostBody interface{}
var localVarFileName string
var localVarFileBytes []byte
// add default headers if any
for key := range a.Configuration.DefaultHeader {
localVarHeaderParams[key] = a.Configuration.DefaultHeader[key]
}
var collectionFormat = "csv"
if collectionFormat == "multi" {
for _, value := range enumQueryStringArray {
localVarQueryParams.Add("enum_query_string_array", value)
}
} else {
localVarQueryParams.Add("enum_query_string_array", a.Configuration.APIClient.ParameterToString(enumQueryStringArray, collectionFormat))
}
localVarQueryParams.Add("enum_query_string", a.Configuration.APIClient.ParameterToString(enumQueryString, ""))
localVarQueryParams.Add("enum_query_integer", a.Configuration.APIClient.ParameterToString(enumQueryInteger, ""))
// to determine the Content-Type header
localVarHttpContentTypes := []string{ "application/json", }
// set Content-Type header
localVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)
if localVarHttpContentType != "" {
localVarHeaderParams["Content-Type"] = localVarHttpContentType
}
// to determine the Accept header
localVarHttpHeaderAccepts := []string{
"application/json",
}
// set Accept header
localVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)
if localVarHttpHeaderAccept != "" {
localVarHeaderParams["Accept"] = localVarHttpHeaderAccept
}
// header params "enum_header_string_array"
localVarHeaderParams["enum_header_string_array"] = a.Configuration.APIClient.ParameterToString(enumHeaderStringArray, "")
// header params "enum_header_string"
localVarHeaderParams["enum_header_string"] = a.Configuration.APIClient.ParameterToString(enumHeaderString, "")
localVarFormParams["enumFormStringArray"] = a.Configuration.APIClient.ParameterToString(enumFormStringArray, "")
localVarFormParams["enumFormString"] = a.Configuration.APIClient.ParameterToString(enumFormString, "")
localVarFormParams["enumQueryDouble"] = a.Configuration.APIClient.ParameterToString(enumQueryDouble, "")
localVarHttpResponse, err := a.Configuration.APIClient.CallAPI(localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)
if err != nil {
return NewAPIResponse(localVarHttpResponse.RawResponse), err
}
return NewAPIResponse(localVarHttpResponse.RawResponse), err
}

View File

@@ -0,0 +1,56 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
import (
"time"
)
type FormatTest struct {
Integer int32 `json:"integer,omitempty"`
Int32_ int32 `json:"int32,omitempty"`
Int64_ int64 `json:"int64,omitempty"`
Number float32 `json:"number,omitempty"`
Float float32 `json:"float,omitempty"`
Double float64 `json:"double,omitempty"`
String_ string `json:"string,omitempty"`
Byte_ string `json:"byte,omitempty"`
Binary string `json:"binary,omitempty"`
Date time.Time `json:"date,omitempty"`
DateTime time.Time `json:"dateTime,omitempty"`
Uuid string `json:"uuid,omitempty"`
Password string `json:"password,omitempty"`
}

View File

@@ -0,0 +1,30 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type HasOnlyReadOnly struct {
Bar string `json:"bar,omitempty"`
Foo string `json:"foo,omitempty"`
}

View File

@@ -0,0 +1,28 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type List struct {
Var123List string `json:"123-list,omitempty"`
}

View File

@@ -0,0 +1,30 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type MapTest struct {
MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"`
MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"`
}

View File

@@ -0,0 +1,36 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
import (
"time"
)
type MixedPropertiesAndAdditionalPropertiesClass struct {
Uuid string `json:"uuid,omitempty"`
DateTime time.Time `json:"dateTime,omitempty"`
Map_ map[string]Animal `json:"map,omitempty"`
}

View File

@@ -0,0 +1,31 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
// Model for testing model name starting with number
type Model200Response struct {
Name int32 `json:"name,omitempty"`
Class string `json:"class,omitempty"`
}

View File

@@ -0,0 +1,29 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
// Model for testing reserved words
type ModelReturn struct {
Return_ int32 `json:"return,omitempty"`
}

View File

@@ -0,0 +1,35 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
// Model for testing model name same as property name
type Name struct {
Name int32 `json:"name,omitempty"`
SnakeCase int32 `json:"snake_case,omitempty"`
Property string `json:"property,omitempty"`
Var123Number int32 `json:"123Number,omitempty"`
}

View File

@@ -0,0 +1,28 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type NumberOnly struct {
JustNumber float32 `json:"JustNumber,omitempty"`
}

View File

@@ -0,0 +1,30 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type ReadOnlyFirst struct {
Bar string `json:"bar,omitempty"`
Baz string `json:"baz,omitempty"`
}

View File

@@ -0,0 +1,28 @@
/*
* Swagger Petstore
*
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
* Generated by: https://github.com/swagger-api/swagger-codegen.git
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package petstore
type SpecialModelName struct {
SpecialPropertyName int64 `json:"$special[property.name],omitempty"`
}