forked from loafle/openapi-generator-original
* disabling resty logger * #3687 updating go-petstore
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
30
samples/client/petstore/go/go-petstore/animal.go
Normal file
30
samples/client/petstore/go/go-petstore/animal.go
Normal 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"`
|
||||
}
|
||||
26
samples/client/petstore/go/go-petstore/animal_farm.go
Normal file
26
samples/client/petstore/go/go-petstore/animal_farm.go
Normal 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 {
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
@@ -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"`
|
||||
}
|
||||
32
samples/client/petstore/go/go-petstore/array_test.go
Normal file
32
samples/client/petstore/go/go-petstore/array_test.go
Normal 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"`
|
||||
}
|
||||
32
samples/client/petstore/go/go-petstore/cat.go
Normal file
32
samples/client/petstore/go/go-petstore/cat.go
Normal 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"`
|
||||
}
|
||||
28
samples/client/petstore/go/go-petstore/client.go
Normal file
28
samples/client/petstore/go/go-petstore/client.go
Normal 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"`
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
|
||||
11
samples/client/petstore/go/go-petstore/docs/Animal.md
Normal file
11
samples/client/petstore/go/go-petstore/docs/Animal.md
Normal 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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
12
samples/client/petstore/go/go-petstore/docs/ArrayTest.md
Normal file
12
samples/client/petstore/go/go-petstore/docs/ArrayTest.md
Normal 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)
|
||||
|
||||
|
||||
12
samples/client/petstore/go/go-petstore/docs/Cat.md
Normal file
12
samples/client/petstore/go/go-petstore/docs/Cat.md
Normal 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)
|
||||
|
||||
|
||||
10
samples/client/petstore/go/go-petstore/docs/Client.md
Normal file
10
samples/client/petstore/go/go-petstore/docs/Client.md
Normal 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)
|
||||
|
||||
|
||||
12
samples/client/petstore/go/go-petstore/docs/Dog.md
Normal file
12
samples/client/petstore/go/go-petstore/docs/Dog.md
Normal 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)
|
||||
|
||||
|
||||
11
samples/client/petstore/go/go-petstore/docs/EnumArrays.md
Normal file
11
samples/client/petstore/go/go-petstore/docs/EnumArrays.md
Normal 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)
|
||||
|
||||
|
||||
9
samples/client/petstore/go/go-petstore/docs/EnumClass.md
Normal file
9
samples/client/petstore/go/go-petstore/docs/EnumClass.md
Normal 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)
|
||||
|
||||
|
||||
12
samples/client/petstore/go/go-petstore/docs/EnumTest.md
Normal file
12
samples/client/petstore/go/go-petstore/docs/EnumTest.md
Normal 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)
|
||||
|
||||
|
||||
113
samples/client/petstore/go/go-petstore/docs/FakeApi.md
Normal file
113
samples/client/petstore/go/go-petstore/docs/FakeApi.md
Normal 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)
|
||||
|
||||
22
samples/client/petstore/go/go-petstore/docs/FormatTest.md
Normal file
22
samples/client/petstore/go/go-petstore/docs/FormatTest.md
Normal 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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
10
samples/client/petstore/go/go-petstore/docs/List.md
Normal file
10
samples/client/petstore/go/go-petstore/docs/List.md
Normal 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)
|
||||
|
||||
|
||||
11
samples/client/petstore/go/go-petstore/docs/MapTest.md
Normal file
11
samples/client/petstore/go/go-petstore/docs/MapTest.md
Normal 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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
10
samples/client/petstore/go/go-petstore/docs/ModelReturn.md
Normal file
10
samples/client/petstore/go/go-petstore/docs/ModelReturn.md
Normal 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)
|
||||
|
||||
|
||||
13
samples/client/petstore/go/go-petstore/docs/Name.md
Normal file
13
samples/client/petstore/go/go-petstore/docs/Name.md
Normal 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)
|
||||
|
||||
|
||||
10
samples/client/petstore/go/go-petstore/docs/NumberOnly.md
Normal file
10
samples/client/petstore/go/go-petstore/docs/NumberOnly.md
Normal 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)
|
||||
|
||||
|
||||
11
samples/client/petstore/go/go-petstore/docs/ReadOnlyFirst.md
Normal file
11
samples/client/petstore/go/go-petstore/docs/ReadOnlyFirst.md
Normal 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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
32
samples/client/petstore/go/go-petstore/dog.go
Normal file
32
samples/client/petstore/go/go-petstore/dog.go
Normal 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"`
|
||||
}
|
||||
30
samples/client/petstore/go/go-petstore/enum_arrays.go
Normal file
30
samples/client/petstore/go/go-petstore/enum_arrays.go
Normal 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"`
|
||||
}
|
||||
26
samples/client/petstore/go/go-petstore/enum_class.go
Normal file
26
samples/client/petstore/go/go-petstore/enum_class.go
Normal 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 {
|
||||
}
|
||||
32
samples/client/petstore/go/go-petstore/enum_test.go
Normal file
32
samples/client/petstore/go/go-petstore/enum_test.go
Normal 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"`
|
||||
}
|
||||
266
samples/client/petstore/go/go-petstore/fake_api.go
Normal file
266
samples/client/petstore/go/go-petstore/fake_api.go
Normal 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
|
||||
}
|
||||
|
||||
56
samples/client/petstore/go/go-petstore/format_test.go
Normal file
56
samples/client/petstore/go/go-petstore/format_test.go
Normal 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"`
|
||||
}
|
||||
30
samples/client/petstore/go/go-petstore/has_only_read_only.go
Normal file
30
samples/client/petstore/go/go-petstore/has_only_read_only.go
Normal 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"`
|
||||
}
|
||||
28
samples/client/petstore/go/go-petstore/list.go
Normal file
28
samples/client/petstore/go/go-petstore/list.go
Normal 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"`
|
||||
}
|
||||
30
samples/client/petstore/go/go-petstore/map_test.go
Normal file
30
samples/client/petstore/go/go-petstore/map_test.go
Normal 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"`
|
||||
}
|
||||
@@ -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"`
|
||||
}
|
||||
31
samples/client/petstore/go/go-petstore/model_200_response.go
Normal file
31
samples/client/petstore/go/go-petstore/model_200_response.go
Normal 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"`
|
||||
}
|
||||
29
samples/client/petstore/go/go-petstore/model_return.go
Normal file
29
samples/client/petstore/go/go-petstore/model_return.go
Normal 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"`
|
||||
}
|
||||
35
samples/client/petstore/go/go-petstore/name.go
Normal file
35
samples/client/petstore/go/go-petstore/name.go
Normal 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"`
|
||||
}
|
||||
28
samples/client/petstore/go/go-petstore/number_only.go
Normal file
28
samples/client/petstore/go/go-petstore/number_only.go
Normal 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"`
|
||||
}
|
||||
30
samples/client/petstore/go/go-petstore/read_only_first.go
Normal file
30
samples/client/petstore/go/go-petstore/read_only_first.go
Normal 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"`
|
||||
}
|
||||
28
samples/client/petstore/go/go-petstore/special_model_name.go
Normal file
28
samples/client/petstore/go/go-petstore/special_model_name.go
Normal 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"`
|
||||
}
|
||||
Reference in New Issue
Block a user