forked from loafle/openapi-generator-original
mapped uuid to str in python
This commit is contained in:
parent
59f9849ca0
commit
87c6566bd0
@ -62,6 +62,8 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
// mapped to String as a workaround
|
||||
typeMapping.put("binary", "str");
|
||||
typeMapping.put("ByteArray", "str");
|
||||
// map uuid to string for the time being
|
||||
typeMapping.put("UUID", "str");
|
||||
|
||||
// from https://docs.python.org/release/2.5.4/ref/keywords.html
|
||||
setReservedWordsLowerCase(
|
||||
|
@ -590,6 +590,7 @@ paths:
|
||||
in: formData
|
||||
description: None
|
||||
- name: number
|
||||
type: number
|
||||
maximum: 543.2
|
||||
minimum: 32.1
|
||||
in: formData
|
||||
@ -890,6 +891,9 @@ definitions:
|
||||
dateTime:
|
||||
type: string
|
||||
format: date-time
|
||||
uuid:
|
||||
type: string
|
||||
format: uuid
|
||||
password:
|
||||
type: string
|
||||
format: password
|
||||
|
@ -5,7 +5,7 @@ This Python package is automatically generated by the [Swagger Codegen](https://
|
||||
|
||||
- API version: 1.0.0
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-04-20T22:11:45.927+08:00
|
||||
- Build date: 2016-04-27T17:36:32.266+08:00
|
||||
- Build package: class io.swagger.codegen.languages.PythonClientCodegen
|
||||
|
||||
## Requirements.
|
||||
@ -50,18 +50,26 @@ import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
# create an instance of the API class
|
||||
api_instance = swagger_client.PetApi
|
||||
body = swagger_client.Pet() # Pet | Pet object that needs to be added to the store
|
||||
api_instance = swagger_client.FakeApi
|
||||
number = 3.4 # float | None
|
||||
double = 1.2 # float | None
|
||||
string = 'string_example' # str | None
|
||||
byte = 'B' # str | None
|
||||
integer = 56 # int | None (optional)
|
||||
int32 = 56 # int | None (optional)
|
||||
int64 = 789 # int | None (optional)
|
||||
float = 3.4 # float | None (optional)
|
||||
binary = 'B' # str | None (optional)
|
||||
date = '2013-10-20' # date | None (optional)
|
||||
date_time = '2013-10-20T19:20:30+01:00' # datetime | None (optional)
|
||||
password = 'password_example' # str | None (optional)
|
||||
|
||||
try:
|
||||
# Add a new pet to the store
|
||||
api_instance.add_pet(body)
|
||||
# Fake endpoint for testing various parameters
|
||||
api_instance.test_endpoint_parameters(number, double, string, byte, integer=integer, int32=int32, int64=int64, float=float, binary=binary, date=date, date_time=date_time, password=password)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->add_pet: %s\n" % e
|
||||
print "Exception when calling FakeApi->test_endpoint_parameters: %s\n" % e
|
||||
|
||||
```
|
||||
|
||||
@ -71,6 +79,7 @@ All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*FakeApi* | [**test_endpoint_parameters**](docs/FakeApi.md#test_endpoint_parameters) | **POST** /fake | Fake endpoint for testing various parameters
|
||||
*PetApi* | [**add_pet**](docs/PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
*PetApi* | [**delete_pet**](docs/PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
*PetApi* | [**find_pets_by_status**](docs/PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
|
@ -10,11 +10,12 @@ Name | Type | Description | Notes
|
||||
**float** | **float** | | [optional]
|
||||
**double** | **float** | | [optional]
|
||||
**string** | **str** | | [optional]
|
||||
**byte** | **str** | | [optional]
|
||||
**byte** | **str** | |
|
||||
**binary** | **str** | | [optional]
|
||||
**date** | **date** | | [optional]
|
||||
**date** | **date** | |
|
||||
**date_time** | **datetime** | | [optional]
|
||||
**password** | **str** | | [optional]
|
||||
**uuid** | **str** | | [optional]
|
||||
**password** | **str** | |
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
@ -17,6 +17,7 @@ from .models.tag import Tag
|
||||
from .models.user import User
|
||||
|
||||
# import apis into sdk package
|
||||
from .apis.fake_api import FakeApi
|
||||
from .apis.pet_api import PetApi
|
||||
from .apis.store_api import StoreApi
|
||||
from .apis.user_api import UserApi
|
||||
|
@ -1,6 +1,7 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
# import apis into api package
|
||||
from .fake_api import FakeApi
|
||||
from .pet_api import PetApi
|
||||
from .store_api import StoreApi
|
||||
from .user_api import UserApi
|
||||
|
@ -48,6 +48,7 @@ class FormatTest(object):
|
||||
'binary': 'str',
|
||||
'date': 'date',
|
||||
'date_time': 'datetime',
|
||||
'uuid': 'str',
|
||||
'password': 'str'
|
||||
}
|
||||
|
||||
@ -63,6 +64,7 @@ class FormatTest(object):
|
||||
'binary': 'binary',
|
||||
'date': 'date',
|
||||
'date_time': 'dateTime',
|
||||
'uuid': 'uuid',
|
||||
'password': 'password'
|
||||
}
|
||||
|
||||
@ -77,6 +79,7 @@ class FormatTest(object):
|
||||
self._binary = None
|
||||
self._date = None
|
||||
self._date_time = None
|
||||
self._uuid = None
|
||||
self._password = None
|
||||
|
||||
@property
|
||||
@ -321,6 +324,28 @@ class FormatTest(object):
|
||||
"""
|
||||
self._date_time = date_time
|
||||
|
||||
@property
|
||||
def uuid(self):
|
||||
"""
|
||||
Gets the uuid of this FormatTest.
|
||||
|
||||
|
||||
:return: The uuid of this FormatTest.
|
||||
:rtype: str
|
||||
"""
|
||||
return self._uuid
|
||||
|
||||
@uuid.setter
|
||||
def uuid(self, uuid):
|
||||
"""
|
||||
Sets the uuid of this FormatTest.
|
||||
|
||||
|
||||
:param uuid: The uuid of this FormatTest.
|
||||
:type: str
|
||||
"""
|
||||
self._uuid = uuid
|
||||
|
||||
@property
|
||||
def password(self):
|
||||
"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user