mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-21 03:37:08 +00:00
fix swift mapping with int and number
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
# swagger_client\PetApi
|
||||
# swagger_client.PetApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**add_pet**](PetApi.md#add_pet) | **POST** /pet | Add a new pet to the store
|
||||
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
[**add_pet_using_byte_array**](PetApi.md#add_pet_using_byte_array) | **POST** /pet?testing_byte_array=true | Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
[**delete_pet**](PetApi.md#delete_pet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**find_pets_by_status**](PetApi.md#find_pets_by_status) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**find_pets_by_tags**](PetApi.md#find_pets_by_tags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**get_pet_by_id**](PetApi.md#get_pet_by_id) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
[**get_pet_by_id_in_object**](PetApi.md#get_pet_by_id_in_object) | **GET** /pet/{petId}?response=inline_arbitrary_object | Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
[**pet_pet_idtesting_byte_arraytrue_get**](PetApi.md#pet_pet_idtesting_byte_arraytrue_get) | **GET** /pet/{petId}?testing_byte_array=true | Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
[**update_pet**](PetApi.md#update_pet) | **PUT** /pet | Update an existing pet
|
||||
[**update_pet_with_form**](PetApi.md#update_pet_with_form) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**upload_file**](PetApi.md#upload_file) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
@@ -26,11 +26,10 @@ Add a new pet to the store
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@@ -41,7 +40,7 @@ body = swagger_client.Pet() # Pet | Pet object that needs to be added to the sto
|
||||
|
||||
try:
|
||||
# Add a new pet to the store
|
||||
api_instance.add_pet(body=body);
|
||||
api_instance.add_pet(body=body)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->add_pet: %s\n" % e
|
||||
```
|
||||
@@ -76,11 +75,10 @@ Fake endpoint to test byte array in body parameter for adding a new pet to the s
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@@ -91,7 +89,7 @@ body = 'B' # str | Pet object in the form of byte array (optional)
|
||||
|
||||
try:
|
||||
# Fake endpoint to test byte array in body parameter for adding a new pet to the store
|
||||
api_instance.add_pet_using_byte_array(body=body);
|
||||
api_instance.add_pet_using_byte_array(body=body)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->add_pet_using_byte_array: %s\n" % e
|
||||
```
|
||||
@@ -126,11 +124,10 @@ Deletes a pet
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@@ -142,7 +139,7 @@ api_key = 'api_key_example' # str | (optional)
|
||||
|
||||
try:
|
||||
# Deletes a pet
|
||||
api_instance.delete_pet(pet_id, api_key=api_key);
|
||||
api_instance.delete_pet(pet_id, api_key=api_key)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->delete_pet: %s\n" % e
|
||||
```
|
||||
@@ -178,11 +175,10 @@ Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@@ -193,7 +189,7 @@ status = ['available'] # list[str] | Status values that need to be considered fo
|
||||
|
||||
try:
|
||||
# Finds Pets by status
|
||||
api_response = api_instance.find_pets_by_status(status=status);
|
||||
api_response = api_instance.find_pets_by_status(status=status)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->find_pets_by_status: %s\n" % e
|
||||
@@ -229,11 +225,10 @@ Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@@ -244,7 +239,7 @@ tags = ['tags_example'] # list[str] | Tags to filter by (optional)
|
||||
|
||||
try:
|
||||
# Finds Pets by tags
|
||||
api_response = api_instance.find_pets_by_tags(tags=tags);
|
||||
api_response = api_instance.find_pets_by_tags(tags=tags)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->find_pets_by_tags: %s\n" % e
|
||||
@@ -280,14 +275,13 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
@@ -299,7 +293,7 @@ pet_id = 789 # int | ID of pet that needs to be fetched
|
||||
|
||||
try:
|
||||
# Find pet by ID
|
||||
api_response = api_instance.get_pet_by_id(pet_id);
|
||||
api_response = api_instance.get_pet_by_id(pet_id)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->get_pet_by_id: %s\n" % e
|
||||
@@ -335,14 +329,13 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
@@ -354,7 +347,7 @@ pet_id = 789 # int | ID of pet that needs to be fetched
|
||||
|
||||
try:
|
||||
# Fake endpoint to test inline arbitrary object return by 'Find pet by ID'
|
||||
api_response = api_instance.get_pet_by_id_in_object(pet_id);
|
||||
api_response = api_instance.get_pet_by_id_in_object(pet_id)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->get_pet_by_id_in_object: %s\n" % e
|
||||
@@ -390,14 +383,13 @@ Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error cond
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure API key authorization: api_key
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY';
|
||||
swagger_client.configuration.api_key['api_key'] = 'YOUR_API_KEY'
|
||||
# Uncomment below to setup prefix (e.g. BEARER) for API key, if needed
|
||||
# swagger_client.configuration.api_key_prefix['api_key'] = 'BEARER'
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
@@ -409,7 +401,7 @@ pet_id = 789 # int | ID of pet that needs to be fetched
|
||||
|
||||
try:
|
||||
# Fake endpoint to test byte array return by 'Find pet by ID'
|
||||
api_response = api_instance.pet_pet_idtesting_byte_arraytrue_get(pet_id);
|
||||
api_response = api_instance.pet_pet_idtesting_byte_arraytrue_get(pet_id)
|
||||
pprint(api_response)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->pet_pet_idtesting_byte_arraytrue_get: %s\n" % e
|
||||
@@ -445,11 +437,10 @@ Update an existing pet
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@@ -460,7 +451,7 @@ body = swagger_client.Pet() # Pet | Pet object that needs to be added to the sto
|
||||
|
||||
try:
|
||||
# Update an existing pet
|
||||
api_instance.update_pet(body=body);
|
||||
api_instance.update_pet(body=body)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->update_pet: %s\n" % e
|
||||
```
|
||||
@@ -495,11 +486,10 @@ Updates a pet in the store with form data
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@@ -512,7 +502,7 @@ status = 'status_example' # str | Updated status of the pet (optional)
|
||||
|
||||
try:
|
||||
# Updates a pet in the store with form data
|
||||
api_instance.update_pet_with_form(pet_id, name=name, status=status);
|
||||
api_instance.update_pet_with_form(pet_id, name=name, status=status)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->update_pet_with_form: %s\n" % e
|
||||
```
|
||||
@@ -549,11 +539,10 @@ uploads an image
|
||||
|
||||
### Example
|
||||
```python
|
||||
import time
|
||||
import swagger_client
|
||||
from swagger_client.rest import ApiException
|
||||
from pprint import pprint
|
||||
import time
|
||||
|
||||
|
||||
# Configure OAuth2 access token for authorization: petstore_auth
|
||||
swagger_client.configuration.access_token = 'YOUR_ACCESS_TOKEN'
|
||||
@@ -566,7 +555,7 @@ file = '/path/to/file.txt' # file | file to upload (optional)
|
||||
|
||||
try:
|
||||
# uploads an image
|
||||
api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file);
|
||||
api_instance.upload_file(pet_id, additional_metadata=additional_metadata, file=file)
|
||||
except ApiException as e:
|
||||
print "Exception when calling PetApi->upload_file: %s\n" % e
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user