Justin Black 539ec23298 [python-client] Add model default values (#1776)
* Adds two models to the v2.0 spec, uses examples as defaults in python client

* Adds array default and type_holder_default and type_holder_example tests

* Re-generated python security client with ./bin/security/python-petstore.sh

* Changes comment text, rebased master

* Updates client + server samples

* Adds missing samples updates

* Changes python client to look for true or false with booleans in toDefaultValue

* Changes boolean casting to use Boolean.valueOf

* Adds deserialization fix for python tests

* Changes Mock to namedtuple in python deserialization tests

* Actually remove unittest.mock
2019-01-09 11:18:35 +08:00

104 lines
3.0 KiB
Markdown

# petstore-api
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =end --
This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
## Requirements.
Python 2.7 and 3.4+
## Installation & Usage
### pip install
If the python package is hosted on Github, you can install directly from Github
```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)
Then import the package:
```python
import petstore_api
```
### Setuptools
Install via [Setuptools](http://pypi.python.org/pypi/setuptools).
```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)
Then import the package:
```python
import petstore_api
```
## Getting Started
Please follow the [installation procedure](#installation--usage) and then run the following:
```python
from __future__ import print_function
import time
import petstore_api
from petstore_api.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = petstore_api.FakeApi(petstore_api.ApiClient(configuration))
test_code_inject____end____rn_n_r = 'test_code_inject____end____rn_n_r_example' # str | To test code injection */ ' \\\" =end -- \\\\r\\\\n \\\\n \\\\r (optional)
try:
# To test code injection */ ' \" =end -- \\r\\n \\n \\r
api_instance.test_code_inject____end__rn_n_r(test_code_inject____end____rn_n_r=test_code_inject____end____rn_n_r)
except ApiException as e:
print("Exception when calling FakeApi->test_code_inject____end__rn_n_r: %s\n" % e)
```
## Documentation for API Endpoints
All URIs are relative to *http://petstore.swagger.io */ ' \" =end -- \\r\\n \\n \\r/v2 */ ' \" =end -- \\r\\n \\n \\r*
Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*FakeApi* | [**test_code_inject____end__rn_n_r**](docs/FakeApi.md#test_code_inject____end__rn_n_r) | **PUT** /fake | To test code injection */ ' \" =end -- \\r\\n \\n \\r
## Documentation For Models
- [ModelReturn](docs/ModelReturn.md)
## Documentation For Authorization
## api_key
- **Type**: API key
- **API key parameter name**: api_key */ ' " =end -- \r\n \n \r
- **Location**: HTTP header
## petstore_auth
- **Type**: OAuth
- **Flow**: implicit
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
- **Scopes**:
- **write:pets**: modify pets in your account */ ' \" =end -- \\r\\n \\n \\r
- **read:pets**: read your pets */ ' \" =end -- \\r\\n \\n \\r
## Author
something@something.abc */ ' \" =end -- \\r\\n \\n \\r