* Fixes additionalProperties values for models, updates docs, adds tag test of it, fixes frit and gmfruit tests * Moves this.setDisallowAdditionalPropertiesIfNotPresent higher * Makes setting additional_properties_model_instances contingent on the presence of addprosp in schema, updates sample spec composed schemas to remove addprops False form two * Fixes oneOf anyOf allOf instantiation logic * Removes Address from Cat definition * Adds required vars for apple and banana, removes required vars from composed schema init sig * Updates composed schema vars to be set on self and all composed instances * Removes get_unused_args, get_var_name_to_model_instances, and get_additional_properties_model_instances * Fixes fruit + deserilization tests, creates ComposedSchemaWithPropsAndNoAddProps * Fixes FruitReq tests * Fixes GmFruit tests * Fixes discard_unknown_keys tests * Samples updated * Removes additionalproperties False in Child * Samples updated * Improves handling of v2 and v3 specs for isFreeFormObject, v2 sample spec updated with link to bug * Adds cli option disallowAdditionalPropertiesIfNotPresent to python * Adds getAdditionalProperties method so the value for addProps will be correct * Reverts file * Reverts file * Updates python doc * Reverted anytype_3 definition * Updates test_deserialize_lizard * Updates test_deserialize_dict_str_dog * Updates testDog * Updates testChild * Adds v2 python_composition sample * Adds needed files for python testing * Adds existing tests into the new python sample * Fixes test_dog * Removes addProps false form Dog * Fixes testChild * Updates how additionalProperties are set * Fixes empty_map type * Type generation fixed for v2 and v3 specs * Refactors getTypeString, updates artifactids in pom.xml files * Adds new python sample to CI testing I think * Fixes artifactId collision, regenrates docs
x-auth-id-alias
This specification shows how to use x-auth-id-alias extension for API keys.
This Python package is automatically generated by the OpenAPI Generator project:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
Requirements.
Python >= 3.6
Installation & Usage
pip install
If the python package is hosted on a repository, you can install directly using:
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:
import x_auth_id_alias
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import x_auth_id_alias
Getting Started
Please follow the installation procedure and then run the following:
import time
import x_auth_id_alias
from pprint import pprint
from x_auth_id_alias.api import usage_api
# Defining the host is optional and defaults to http://petstore.swagger.io:80/v2
# See configuration.py for a list of all supported configuration parameters.
configuration = x_auth_id_alias.Configuration(
host = "http://petstore.swagger.io:80/v2"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: api_key
configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'
# Configure API key authorization: api_key_query
configuration.api_key['api_key_query'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key_query'] = 'Bearer'
# Enter a context with an instance of the API client
with x_auth_id_alias.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = usage_api.UsageApi(api_client)
try:
# Use any API key
api_response = api_instance.any_key()
pprint(api_response)
except x_auth_id_alias.ApiException as e:
print("Exception when calling UsageApi->any_key: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to http://petstore.swagger.io:80/v2
| Class | Method | HTTP request | Description |
|---|---|---|---|
| UsageApi | any_key | GET /any | Use any API key |
| UsageApi | both_keys | GET /both | Use both API keys |
| UsageApi | key_in_header | GET /header | Use API key in header |
| UsageApi | key_in_query | GET /query | Use API key in query |
Documentation For Models
Documentation For Authorization
api_key
- Type: API key
- API key parameter name: X-Api-Key
- Location: HTTP header
api_key_query
- Type: API key
- API key parameter name: api_key
- Location: URL query string
Author
Notes for Large OpenAPI documents
If the OpenAPI document is large, imports in x_auth_id_alias.apis and x_auth_id_alias.models may fail with a RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions:
Solution 1: Use specific imports for apis and models like:
from x_auth_id_alias.api.default_api import DefaultApifrom x_auth_id_alias.model.pet import Pet
Solution 2: Before importing the package, adjust the maximum recursion limit as shown below:
import sys
sys.setrecursionlimit(1500)
import x_auth_id_alias
from x_auth_id_alias.apis import *
from x_auth_id_alias.models import *