forked from loafle/openapi-generator-original
better code injection handling for python
This commit is contained in:
101
samples/client/petstore-security-test/python/README.md
Normal file
101
samples/client/petstore-security-test/python/README.md
Normal file
@@ -0,0 +1,101 @@
|
||||
# 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 [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project:
|
||||
|
||||
- API version: 1.0.0 */ ' \" =end
|
||||
- Package version: 1.0.0
|
||||
- Build date: 2016-06-28T16:59:35.203+08:00
|
||||
- Build package: class io.swagger.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
|
||||
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
|
||||
test_code_inject____end = 'test_code_inject____end_example' # str | To test code injection */ ' \" =end (optional)
|
||||
|
||||
try:
|
||||
# To test code injection */ ' \" =end
|
||||
api_instance.test_code_inject____end(test_code_inject____end=test_code_inject____end)
|
||||
except ApiException as e:
|
||||
print "Exception when calling FakeApi->test_code_inject____end: %s\n" % e
|
||||
|
||||
```
|
||||
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *https://petstore.swagger.io */ ' " =end/v2 */ ' " =end*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*FakeApi* | [**test_code_inject____end**](docs/FakeApi.md#test_code_inject____end) | **PUT** /fake | To test code injection */ ' \" =end
|
||||
|
||||
|
||||
## Documentation For Models
|
||||
|
||||
- [ModelReturn](docs/ModelReturn.md)
|
||||
|
||||
|
||||
## Documentation For Authorization
|
||||
|
||||
|
||||
## api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key */ ' " =end
|
||||
- **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
|
||||
- **read:pets**: read your pets */ ' " =end
|
||||
|
||||
|
||||
## Author
|
||||
|
||||
apiteam@swagger.io */ ' \" =end
|
||||
|
||||
Reference in New Issue
Block a user