forked from loafle/openapi-generator-original
* Fix escaped regex values in Python client (#1517). * Override PythonClientCodegen toRegularExpression() method to correct issue with backslashes being escaped. This issue was a result of calling escapeText() in the parent DefaultCodegen class. * Only escape unescaped forward slashes in PythonClientCodegen. * Override addRegularExpressionDelimiter in PythonClientCodegen.java such that only unescaped forward slashes in the pattern get escaped. * Adds a new test resource .yaml file for specifically testing this issue. * Check for regular expression modifiers in PythonClientCodegen. * Adds check in postProcessPattern() in PythonClientCodegen.java to check if regular expression has modifiers defined. If so, it throws an exception as modifiers are not currently supported in the Python client. * PythonClientCodegen warns that regex modifiers are not supported. * Changes behavior in PythonClientCodegen.java to no longer throw an IllegalArgumentException in the case that a pattern contains modifiers. A warning message will be logged instead stating that modifiers are not currently supported by the codegen class. * Remove warning for PythonClientCodegen regex modifier support. * Removes warning message from PythonClientCodegen.java stating that regular expression modifiers are not currently supported. Further code review and testing revealed that this feature is already supported and working. * Add updated Python client sample files.
This commit is contained in:
@@ -381,6 +381,19 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return toApiName(name);
|
return toApiName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String addRegularExpressionDelimiter(String pattern) {
|
||||||
|
if (StringUtils.isEmpty(pattern)) {
|
||||||
|
return pattern;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!pattern.matches("^/.*")) {
|
||||||
|
// Perform a negative lookbehind on each `/` to ensure that it is escaped.
|
||||||
|
return "/" + pattern.replaceAll("(?<!\\\\)\\/", "\\\\/") + "/";
|
||||||
|
}
|
||||||
|
|
||||||
|
return pattern;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String apiFileFolder() {
|
public String apiFileFolder() {
|
||||||
@@ -635,6 +648,11 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toRegularExpression(String pattern) {
|
||||||
|
return addRegularExpressionDelimiter(pattern);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setParameterExampleValue(CodegenParameter p) {
|
public void setParameterExampleValue(CodegenParameter p) {
|
||||||
String example;
|
String example;
|
||||||
|
|||||||
@@ -17,6 +17,11 @@
|
|||||||
|
|
||||||
package org.openapitools.codegen.python;
|
package org.openapitools.codegen.python;
|
||||||
|
|
||||||
|
import io.swagger.parser.OpenAPIParser;
|
||||||
|
import io.swagger.v3.oas.models.OpenAPI;
|
||||||
|
import io.swagger.v3.oas.models.Operation;
|
||||||
|
import io.swagger.v3.parser.core.models.ParseOptions;
|
||||||
|
import org.openapitools.codegen.CodegenOperation;
|
||||||
import org.testng.Assert;
|
import org.testng.Assert;
|
||||||
import org.testng.annotations.Test;
|
import org.testng.annotations.Test;
|
||||||
|
|
||||||
@@ -54,4 +59,25 @@ public class PythonClientCodegenTest {
|
|||||||
Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
|
Assert.assertEquals(codegen.isHideGenerationTimestamp(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(description = "test regex patterns")
|
||||||
|
public void testRegularExpressionOpenAPISchemaVersion3() {
|
||||||
|
final OpenAPI openAPI = new OpenAPIParser()
|
||||||
|
.readLocation("src/test/resources/3_0/issue_1517.yaml", null, new ParseOptions()).getOpenAPI();
|
||||||
|
final PythonClientCodegen codegen = new PythonClientCodegen();
|
||||||
|
final String path = "/ping";
|
||||||
|
final Operation p = openAPI.getPaths().get(path).getGet();
|
||||||
|
final CodegenOperation op = codegen.fromOperation(path, "get", p, openAPI.getComponents().getSchemas());
|
||||||
|
// pattern_no_forward_slashes '^pattern$'
|
||||||
|
Assert.assertEquals(op.allParams.get(0).pattern, "/^pattern$/");
|
||||||
|
// pattern_two_slashes '/^pattern$/'
|
||||||
|
Assert.assertEquals(op.allParams.get(1).pattern, "/^pattern$/");
|
||||||
|
// pattern_dont_escape_backslash '/^pattern\d{3}$/'
|
||||||
|
Assert.assertEquals(op.allParams.get(2).pattern, "/^pattern\\d{3}$/");
|
||||||
|
// pattern_dont_escape_escaped_forward_slash '/^pattern\/\d{3}$/'
|
||||||
|
Assert.assertEquals(op.allParams.get(3).pattern, "/^pattern\\/\\d{3}$/");
|
||||||
|
// pattern_escape_unescaped_forward_slash '^pattern/\d{3}$'
|
||||||
|
Assert.assertEquals(op.allParams.get(4).pattern, "/^pattern\\/\\d{3}$/");
|
||||||
|
// pattern_with_modifiers '/^pattern\d{3}$/i
|
||||||
|
Assert.assertEquals(op.allParams.get(5).pattern, "/^pattern\\d{3}$/i");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
openapi: 3.0.1
|
||||||
|
info:
|
||||||
|
title: Test Regex generation for parameter validation
|
||||||
|
version: 1.0.0
|
||||||
|
components:
|
||||||
|
headers:
|
||||||
|
|
||||||
|
responses:
|
||||||
|
OK_200:
|
||||||
|
description: OK
|
||||||
|
|
||||||
|
paths:
|
||||||
|
/ping:
|
||||||
|
get:
|
||||||
|
summary: Get Payment Information
|
||||||
|
description: Returns the content of a payment object
|
||||||
|
parameters:
|
||||||
|
- name: pattern_no_forward_slashes
|
||||||
|
in: header
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: '^pattern$'
|
||||||
|
- name: pattern_two_slashes
|
||||||
|
in: header
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: '/^pattern$/'
|
||||||
|
- name: pattern_dont_escape_backslash
|
||||||
|
in: header
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: '^pattern\d{3}$'
|
||||||
|
- name: pattern_dont_escape_escaped_forward_slash
|
||||||
|
in: header
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: '^pattern\/\d{3}$'
|
||||||
|
- name: pattern_escape_unescaped_forward_slash
|
||||||
|
in: header
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: '^pattern/\d{3}$'
|
||||||
|
- name: pattern_with_modifiers
|
||||||
|
in: header
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
pattern: '/^pattern\d{3}$/i'
|
||||||
|
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
$ref: "#/components/responses/OK_200"
|
||||||
@@ -1 +1 @@
|
|||||||
2.3.0-SNAPSHOT
|
3.3.4-SNAPSHOT
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
# petstore-api
|
# 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 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:
|
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
|
- API version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
||||||
- Package version: 1.0.0
|
- Package version: 1.0.0
|
||||||
- Build package: io.swagger.codegen.languages.PythonClientCodegen
|
- Build package: org.openapitools.codegen.languages.PythonClientCodegen
|
||||||
|
|
||||||
## Requirements.
|
## Requirements.
|
||||||
|
|
||||||
@@ -50,13 +50,14 @@ import time
|
|||||||
import petstore_api
|
import petstore_api
|
||||||
from petstore_api.rest import ApiException
|
from petstore_api.rest import ApiException
|
||||||
from pprint import pprint
|
from pprint import pprint
|
||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = petstore_api.FakeApi()
|
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)
|
unknown_base_type = petstore_api.UNKNOWN_BASE_TYPE() # UNKNOWN_BASE_TYPE | (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# To test code injection */ ' \" =end -- \\r\\n \\n \\r
|
# 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)
|
api_instance.test_code_inject____end__rn_n_r(unknown_base_type=unknown_base_type)
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
print("Exception when calling FakeApi->test_code_inject____end__rn_n_r: %s\n" % e)
|
print("Exception when calling FakeApi->test_code_inject____end__rn_n_r: %s\n" % e)
|
||||||
|
|
||||||
@@ -64,7 +65,7 @@ except ApiException as e:
|
|||||||
|
|
||||||
## Documentation for API Endpoints
|
## Documentation for API Endpoints
|
||||||
|
|
||||||
All URIs are relative to *https://petstore.swagger.io */ ' \" =end -- \\r\\n \\n \\r/v2 */ ' \" =end -- \\r\\n \\n \\r*
|
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
|
Class | Method | HTTP request | Description
|
||||||
------------ | ------------- | ------------- | -------------
|
------------ | ------------- | ------------- | -------------
|
||||||
@@ -97,5 +98,6 @@ Class | Method | HTTP request | Description
|
|||||||
|
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
apiteam@swagger.io */ ' \" =end -- \\r\\n \\n \\r
|
something@something.abc */ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# petstore_api.FakeApi
|
# petstore_api.FakeApi
|
||||||
|
|
||||||
All URIs are relative to *https://petstore.swagger.io */ ' \" =end -- \\r\\n \\n \\r/v2 */ ' \" =end -- \\r\\n \\n \\r*
|
All URIs are relative to *http://petstore.swagger.io */ ' \" =end -- \\r\\n \\n \\r/v2 */ ' \" =end -- \\r\\n \\n \\r*
|
||||||
|
|
||||||
Method | HTTP request | Description
|
Method | HTTP request | Description
|
||||||
------------- | ------------- | -------------
|
------------- | ------------- | -------------
|
||||||
@@ -8,7 +8,9 @@ Method | HTTP request | Description
|
|||||||
|
|
||||||
|
|
||||||
# **test_code_inject____end__rn_n_r**
|
# **test_code_inject____end__rn_n_r**
|
||||||
> test_code_inject____end__rn_n_r(test_code_inject____end____rn_n_r=test_code_inject____end____rn_n_r)
|
> test_code_inject____end__rn_n_r(unknown_base_type=unknown_base_type)
|
||||||
|
|
||||||
|
To test code injection */ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
To test code injection */ ' \" =end -- \\r\\n \\n \\r
|
To test code injection */ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
@@ -22,11 +24,11 @@ from pprint import pprint
|
|||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = petstore_api.FakeApi()
|
api_instance = petstore_api.FakeApi()
|
||||||
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)
|
unknown_base_type = petstore_api.UNKNOWN_BASE_TYPE() # UNKNOWN_BASE_TYPE | (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# To test code injection */ ' \" =end -- \\r\\n \\n \\r
|
# 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)
|
api_instance.test_code_inject____end__rn_n_r(unknown_base_type=unknown_base_type)
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
print("Exception when calling FakeApi->test_code_inject____end__rn_n_r: %s\n" % e)
|
print("Exception when calling FakeApi->test_code_inject____end__rn_n_r: %s\n" % e)
|
||||||
```
|
```
|
||||||
@@ -35,7 +37,7 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
**test_code_inject____end____rn_n_r** | **str**| To test code injection */ ' \" =end -- \\r\\n \\n \\r | [optional]
|
**unknown_base_type** | [**UNKNOWN_BASE_TYPE**](UNKNOWN_BASE_TYPE.md)| | [optional]
|
||||||
|
|
||||||
### Return type
|
### Return type
|
||||||
|
|
||||||
@@ -48,7 +50,7 @@ No authorization required
|
|||||||
### HTTP request headers
|
### HTTP request headers
|
||||||
|
|
||||||
- **Content-Type**: application/json, */ \" =end --
|
- **Content-Type**: application/json, */ \" =end --
|
||||||
- **Accept**: application/json, */ \" =end --
|
- **Accept**: Not defined
|
||||||
|
|
||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
||||||
#
|
#
|
||||||
# Usage example: /bin/sh ./git_push.sh wing328 swagger-petstore-perl "minor update"
|
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update"
|
||||||
|
|
||||||
git_user_id=$1
|
git_user_id=$1
|
||||||
git_repo_id=$2
|
git_repo_id=$2
|
||||||
@@ -36,7 +36,7 @@ git_remote=`git remote`
|
|||||||
if [ "$git_remote" = "" ]; then # git remote not defined
|
if [ "$git_remote" = "" ]; then # git remote not defined
|
||||||
|
|
||||||
if [ "$GIT_TOKEN" = "" ]; then
|
if [ "$GIT_TOKEN" = "" ]; then
|
||||||
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git crediential in your environment."
|
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
||||||
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
git remote add origin https://github.com/${git_user_id}/${git_repo_id}.git
|
||||||
else
|
else
|
||||||
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${git_user_id}/${git_repo_id}.git
|
||||||
|
|||||||
@@ -3,18 +3,20 @@
|
|||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Swagger Petstore */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
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 -- # noqa: E501
|
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 -- # noqa: E501
|
||||||
|
|
||||||
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Contact: apiteam@swagger.io */ ' \" =end -- \\r\\n \\n \\r
|
Contact: something@something.abc */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
Generated by: https://openapi-generator.tech
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
__version__ = "1.0.0"
|
||||||
|
|
||||||
# import apis into sdk package
|
# import apis into sdk package
|
||||||
from petstore_api.api.fake_api import FakeApi
|
from petstore_api.api.fake_api import FakeApi
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Swagger Petstore */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
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 -- # noqa: E501
|
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 -- # noqa: E501
|
||||||
|
|
||||||
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Contact: apiteam@swagger.io */ ' \" =end -- \\r\\n \\n \\r
|
Contact: something@something.abc */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
Generated by: https://openapi-generator.tech
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@@ -22,10 +22,10 @@ from petstore_api.api_client import ApiClient
|
|||||||
|
|
||||||
|
|
||||||
class FakeApi(object):
|
class FakeApi(object):
|
||||||
"""NOTE: This class is auto generated by the swagger code generator program.
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
Ref: https://github.com/swagger-api/swagger-codegen
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, api_client=None):
|
def __init__(self, api_client=None):
|
||||||
@@ -34,56 +34,59 @@ class FakeApi(object):
|
|||||||
self.api_client = api_client
|
self.api_client = api_client
|
||||||
|
|
||||||
def test_code_inject____end__rn_n_r(self, **kwargs): # noqa: E501
|
def test_code_inject____end__rn_n_r(self, **kwargs): # noqa: E501
|
||||||
"""To test code injection */ ' \" =end -- \\r\\n \\n \\r # noqa: E501
|
"""To test code injection */ ' \" =end -- \\r\\n \\n \\r # noqa: E501
|
||||||
|
|
||||||
|
To test code injection */ ' \" =end -- \\r\\n \\n \\r # noqa: E501
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please pass async=True
|
asynchronous HTTP request, please pass async_req=True
|
||||||
>>> thread = api.test_code_inject____end__rn_n_r(async=True)
|
>>> thread = api.test_code_inject____end__rn_n_r(async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param async bool
|
:param async_req bool
|
||||||
:param str test_code_inject____end____rn_n_r: To test code injection */ ' \" =end -- \\r\\n \\n \\r
|
:param UNKNOWN_BASE_TYPE unknown_base_type:
|
||||||
:return: None
|
:return: None
|
||||||
If the method is called asynchronously,
|
If the method is called asynchronously,
|
||||||
returns the request thread.
|
returns the request thread.
|
||||||
"""
|
"""
|
||||||
kwargs['_return_http_data_only'] = True
|
kwargs['_return_http_data_only'] = True
|
||||||
if kwargs.get('async'):
|
if kwargs.get('async_req'):
|
||||||
return self.test_code_inject____end__rn_n_r_with_http_info(**kwargs) # noqa: E501
|
return self.test_code_inject____end__rn_n_r_with_http_info(**kwargs) # noqa: E501
|
||||||
else:
|
else:
|
||||||
(data) = self.test_code_inject____end__rn_n_r_with_http_info(**kwargs) # noqa: E501
|
(data) = self.test_code_inject____end__rn_n_r_with_http_info(**kwargs) # noqa: E501
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def test_code_inject____end__rn_n_r_with_http_info(self, **kwargs): # noqa: E501
|
def test_code_inject____end__rn_n_r_with_http_info(self, **kwargs): # noqa: E501
|
||||||
"""To test code injection */ ' \" =end -- \\r\\n \\n \\r # noqa: E501
|
"""To test code injection */ ' \" =end -- \\r\\n \\n \\r # noqa: E501
|
||||||
|
|
||||||
|
To test code injection */ ' \" =end -- \\r\\n \\n \\r # noqa: E501
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please pass async=True
|
asynchronous HTTP request, please pass async_req=True
|
||||||
>>> thread = api.test_code_inject____end__rn_n_r_with_http_info(async=True)
|
>>> thread = api.test_code_inject____end__rn_n_r_with_http_info(async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param async bool
|
:param async_req bool
|
||||||
:param str test_code_inject____end____rn_n_r: To test code injection */ ' \" =end -- \\r\\n \\n \\r
|
:param UNKNOWN_BASE_TYPE unknown_base_type:
|
||||||
:return: None
|
:return: None
|
||||||
If the method is called asynchronously,
|
If the method is called asynchronously,
|
||||||
returns the request thread.
|
returns the request thread.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
all_params = ['test_code_inject____end____rn_n_r'] # noqa: E501
|
local_var_params = locals()
|
||||||
all_params.append('async')
|
|
||||||
|
all_params = ['unknown_base_type'] # noqa: E501
|
||||||
|
all_params.append('async_req')
|
||||||
all_params.append('_return_http_data_only')
|
all_params.append('_return_http_data_only')
|
||||||
all_params.append('_preload_content')
|
all_params.append('_preload_content')
|
||||||
all_params.append('_request_timeout')
|
all_params.append('_request_timeout')
|
||||||
|
|
||||||
params = locals()
|
for key, val in six.iteritems(local_var_params['kwargs']):
|
||||||
for key, val in six.iteritems(params['kwargs']):
|
|
||||||
if key not in all_params:
|
if key not in all_params:
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
"Got an unexpected keyword argument '%s'"
|
"Got an unexpected keyword argument '%s'"
|
||||||
" to method test_code_inject____end__rn_n_r" % key
|
" to method test_code_inject____end__rn_n_r" % key
|
||||||
)
|
)
|
||||||
params[key] = val
|
local_var_params[key] = val
|
||||||
del params['kwargs']
|
del local_var_params['kwargs']
|
||||||
|
|
||||||
collection_formats = {}
|
collection_formats = {}
|
||||||
|
|
||||||
@@ -95,14 +98,10 @@ class FakeApi(object):
|
|||||||
|
|
||||||
form_params = []
|
form_params = []
|
||||||
local_var_files = {}
|
local_var_files = {}
|
||||||
if 'test_code_inject____end____rn_n_r' in params:
|
|
||||||
form_params.append(('test code inject */ ' " =end -- \r\n \n \r', params['test_code_inject____end____rn_n_r'])) # noqa: E501
|
|
||||||
|
|
||||||
body_params = None
|
body_params = None
|
||||||
# HTTP header `Accept`
|
if 'unknown_base_type' in local_var_params:
|
||||||
header_params['Accept'] = self.api_client.select_header_accept(
|
body_params = local_var_params['unknown_base_type']
|
||||||
['application/json', '*/ \" =end -- ']) # noqa: E501
|
|
||||||
|
|
||||||
# HTTP header `Content-Type`
|
# HTTP header `Content-Type`
|
||||||
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501
|
||||||
['application/json', '*/ \" =end -- ']) # noqa: E501
|
['application/json', '*/ \" =end -- ']) # noqa: E501
|
||||||
@@ -120,8 +119,8 @@ class FakeApi(object):
|
|||||||
files=local_var_files,
|
files=local_var_files,
|
||||||
response_type=None, # noqa: E501
|
response_type=None, # noqa: E501
|
||||||
auth_settings=auth_settings,
|
auth_settings=auth_settings,
|
||||||
async=params.get('async'),
|
async_req=local_var_params.get('async_req'),
|
||||||
_return_http_data_only=params.get('_return_http_data_only'),
|
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
|
||||||
_preload_content=params.get('_preload_content', True),
|
_preload_content=local_var_params.get('_preload_content', True),
|
||||||
_request_timeout=params.get('_request_timeout'),
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||||||
collection_formats=collection_formats)
|
collection_formats=collection_formats)
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
"""
|
"""
|
||||||
Swagger Petstore */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
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 -- # noqa: E501
|
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 -- # noqa: E501
|
||||||
|
|
||||||
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Contact: apiteam@swagger.io */ ' \" =end -- \\r\\n \\n \\r
|
Contact: something@something.abc */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
Generated by: https://openapi-generator.tech
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
@@ -29,15 +29,15 @@ from petstore_api import rest
|
|||||||
|
|
||||||
|
|
||||||
class ApiClient(object):
|
class ApiClient(object):
|
||||||
"""Generic API client for Swagger client library builds.
|
"""Generic API client for OpenAPI client library builds.
|
||||||
|
|
||||||
Swagger generic API client. This client handles the client-
|
OpenAPI generic API client. This client handles the client-
|
||||||
server communication, and is invariant across implementations. Specifics of
|
server communication, and is invariant across implementations. Specifics of
|
||||||
the methods and models for each application are generated from the Swagger
|
the methods and models for each application are generated from the OpenAPI
|
||||||
templates.
|
templates.
|
||||||
|
|
||||||
NOTE: This class is auto generated by the swagger code generator program.
|
NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
Ref: https://github.com/swagger-api/swagger-codegen
|
Ref: https://openapi-generator.tech
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
|
|
||||||
:param configuration: .Configuration object for this client
|
:param configuration: .Configuration object for this client
|
||||||
@@ -46,6 +46,8 @@ class ApiClient(object):
|
|||||||
the API.
|
the API.
|
||||||
:param cookie: a cookie to include in the header when making calls
|
:param cookie: a cookie to include in the header when making calls
|
||||||
to the API
|
to the API
|
||||||
|
:param pool_threads: The number of threads to use for async requests
|
||||||
|
to the API. More threads means more concurrent API requests.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
|
PRIMITIVE_TYPES = (float, bool, bytes, six.text_type) + six.integer_types
|
||||||
@@ -59,25 +61,37 @@ class ApiClient(object):
|
|||||||
'datetime': datetime.datetime,
|
'datetime': datetime.datetime,
|
||||||
'object': object,
|
'object': object,
|
||||||
}
|
}
|
||||||
|
_pool = None
|
||||||
|
|
||||||
def __init__(self, configuration=None, header_name=None, header_value=None,
|
def __init__(self, configuration=None, header_name=None, header_value=None,
|
||||||
cookie=None):
|
cookie=None, pool_threads=None):
|
||||||
if configuration is None:
|
if configuration is None:
|
||||||
configuration = Configuration()
|
configuration = Configuration()
|
||||||
self.configuration = configuration
|
self.configuration = configuration
|
||||||
|
self.pool_threads = pool_threads
|
||||||
|
|
||||||
self.pool = ThreadPool()
|
|
||||||
self.rest_client = rest.RESTClientObject(configuration)
|
self.rest_client = rest.RESTClientObject(configuration)
|
||||||
self.default_headers = {}
|
self.default_headers = {}
|
||||||
if header_name is not None:
|
if header_name is not None:
|
||||||
self.default_headers[header_name] = header_value
|
self.default_headers[header_name] = header_value
|
||||||
self.cookie = cookie
|
self.cookie = cookie
|
||||||
# Set default User-Agent.
|
# Set default User-Agent.
|
||||||
self.user_agent = 'Swagger-Codegen/1.0.0/python'
|
self.user_agent = 'OpenAPI-Generator/1.0.0/python'
|
||||||
|
|
||||||
def __del__(self):
|
def __del__(self):
|
||||||
self.pool.close()
|
if self._pool:
|
||||||
self.pool.join()
|
self._pool.close()
|
||||||
|
self._pool.join()
|
||||||
|
self._pool = None
|
||||||
|
|
||||||
|
@property
|
||||||
|
def pool(self):
|
||||||
|
"""Create thread pool on first request
|
||||||
|
avoids instantiating unused threadpool for blocking clients.
|
||||||
|
"""
|
||||||
|
if self._pool is None:
|
||||||
|
self._pool = ThreadPool(self.pool_threads)
|
||||||
|
return self._pool
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def user_agent(self):
|
def user_agent(self):
|
||||||
@@ -177,7 +191,7 @@ class ApiClient(object):
|
|||||||
convert to string in iso8601 format.
|
convert to string in iso8601 format.
|
||||||
If obj is list, sanitize each element in the list.
|
If obj is list, sanitize each element in the list.
|
||||||
If obj is dict, return the dict.
|
If obj is dict, return the dict.
|
||||||
If obj is swagger model, return the properties dict.
|
If obj is OpenAPI model, return the properties dict.
|
||||||
|
|
||||||
:param obj: The data to serialize.
|
:param obj: The data to serialize.
|
||||||
:return: The serialized form of data.
|
:return: The serialized form of data.
|
||||||
@@ -199,12 +213,12 @@ class ApiClient(object):
|
|||||||
obj_dict = obj
|
obj_dict = obj
|
||||||
else:
|
else:
|
||||||
# Convert model obj to dict except
|
# Convert model obj to dict except
|
||||||
# attributes `swagger_types`, `attribute_map`
|
# attributes `openapi_types`, `attribute_map`
|
||||||
# and attributes which value is not None.
|
# and attributes which value is not None.
|
||||||
# Convert attribute name to json key in
|
# Convert attribute name to json key in
|
||||||
# model definition for request.
|
# model definition for request.
|
||||||
obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
|
obj_dict = {obj.attribute_map[attr]: getattr(obj, attr)
|
||||||
for attr, _ in six.iteritems(obj.swagger_types)
|
for attr, _ in six.iteritems(obj.openapi_types)
|
||||||
if getattr(obj, attr) is not None}
|
if getattr(obj, attr) is not None}
|
||||||
|
|
||||||
return {key: self.sanitize_for_serialization(val)
|
return {key: self.sanitize_for_serialization(val)
|
||||||
@@ -245,12 +259,12 @@ class ApiClient(object):
|
|||||||
|
|
||||||
if type(klass) == str:
|
if type(klass) == str:
|
||||||
if klass.startswith('list['):
|
if klass.startswith('list['):
|
||||||
sub_kls = re.match('list\[(.*)\]', klass).group(1)
|
sub_kls = re.match(r'list\[(.*)\]', klass).group(1)
|
||||||
return [self.__deserialize(sub_data, sub_kls)
|
return [self.__deserialize(sub_data, sub_kls)
|
||||||
for sub_data in data]
|
for sub_data in data]
|
||||||
|
|
||||||
if klass.startswith('dict('):
|
if klass.startswith('dict('):
|
||||||
sub_kls = re.match('dict\(([^,]*), (.*)\)', klass).group(2)
|
sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2)
|
||||||
return {k: self.__deserialize(v, sub_kls)
|
return {k: self.__deserialize(v, sub_kls)
|
||||||
for k, v in six.iteritems(data)}
|
for k, v in six.iteritems(data)}
|
||||||
|
|
||||||
@@ -274,12 +288,12 @@ class ApiClient(object):
|
|||||||
def call_api(self, resource_path, method,
|
def call_api(self, resource_path, method,
|
||||||
path_params=None, query_params=None, header_params=None,
|
path_params=None, query_params=None, header_params=None,
|
||||||
body=None, post_params=None, files=None,
|
body=None, post_params=None, files=None,
|
||||||
response_type=None, auth_settings=None, async=None,
|
response_type=None, auth_settings=None, async_req=None,
|
||||||
_return_http_data_only=None, collection_formats=None,
|
_return_http_data_only=None, collection_formats=None,
|
||||||
_preload_content=True, _request_timeout=None):
|
_preload_content=True, _request_timeout=None):
|
||||||
"""Makes the HTTP request (synchronous) and returns deserialized data.
|
"""Makes the HTTP request (synchronous) and returns deserialized data.
|
||||||
|
|
||||||
To make an async request, set the async parameter.
|
To make an async_req request, set the async_req parameter.
|
||||||
|
|
||||||
:param resource_path: Path to method endpoint.
|
:param resource_path: Path to method endpoint.
|
||||||
:param method: Method to call.
|
:param method: Method to call.
|
||||||
@@ -294,7 +308,7 @@ class ApiClient(object):
|
|||||||
:param response: Response data type.
|
:param response: Response data type.
|
||||||
:param files dict: key -> filename, value -> filepath,
|
:param files dict: key -> filename, value -> filepath,
|
||||||
for `multipart/form-data`.
|
for `multipart/form-data`.
|
||||||
:param async bool: execute request asynchronously
|
:param async_req bool: execute request asynchronously
|
||||||
:param _return_http_data_only: response data without head status code
|
:param _return_http_data_only: response data without head status code
|
||||||
and headers
|
and headers
|
||||||
:param collection_formats: dict of collection formats for path, query,
|
:param collection_formats: dict of collection formats for path, query,
|
||||||
@@ -307,13 +321,13 @@ class ApiClient(object):
|
|||||||
timeout. It can also be a pair (tuple) of
|
timeout. It can also be a pair (tuple) of
|
||||||
(connection, read) timeouts.
|
(connection, read) timeouts.
|
||||||
:return:
|
:return:
|
||||||
If async parameter is True,
|
If async_req parameter is True,
|
||||||
the request will be called asynchronously.
|
the request will be called asynchronously.
|
||||||
The method will return the request thread.
|
The method will return the request thread.
|
||||||
If parameter async is False or missing,
|
If parameter async_req is False or missing,
|
||||||
then the method will return the response directly.
|
then the method will return the response directly.
|
||||||
"""
|
"""
|
||||||
if not async:
|
if not async_req:
|
||||||
return self.__call_api(resource_path, method,
|
return self.__call_api(resource_path, method,
|
||||||
path_params, query_params, header_params,
|
path_params, query_params, header_params,
|
||||||
body, post_params, files,
|
body, post_params, files,
|
||||||
@@ -546,7 +560,7 @@ class ApiClient(object):
|
|||||||
return data
|
return data
|
||||||
|
|
||||||
def __deserialize_object(self, value):
|
def __deserialize_object(self, value):
|
||||||
"""Return a original value.
|
"""Return an original value.
|
||||||
|
|
||||||
:return: object.
|
:return: object.
|
||||||
"""
|
"""
|
||||||
@@ -599,13 +613,13 @@ class ApiClient(object):
|
|||||||
:return: model object.
|
:return: model object.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not klass.swagger_types and not hasattr(klass,
|
if not klass.openapi_types and not hasattr(klass,
|
||||||
'get_real_child_model'):
|
'get_real_child_model'):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
if klass.swagger_types is not None:
|
if klass.openapi_types is not None:
|
||||||
for attr, attr_type in six.iteritems(klass.swagger_types):
|
for attr, attr_type in six.iteritems(klass.openapi_types):
|
||||||
if (data is not None and
|
if (data is not None and
|
||||||
klass.attribute_map[attr] in data and
|
klass.attribute_map[attr] in data and
|
||||||
isinstance(data, (list, dict))):
|
isinstance(data, (list, dict))):
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Swagger Petstore */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
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 -- # noqa: E501
|
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 -- # noqa: E501
|
||||||
|
|
||||||
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Contact: apiteam@swagger.io */ ' \" =end -- \\r\\n \\n \\r
|
Contact: something@something.abc */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
Generated by: https://openapi-generator.tech
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@@ -38,16 +38,16 @@ class TypeWithDefault(type):
|
|||||||
|
|
||||||
|
|
||||||
class Configuration(six.with_metaclass(TypeWithDefault, object)):
|
class Configuration(six.with_metaclass(TypeWithDefault, object)):
|
||||||
"""NOTE: This class is auto generated by the swagger code generator program.
|
"""NOTE: This class is auto generated by OpenAPI Generator
|
||||||
|
|
||||||
Ref: https://github.com/swagger-api/swagger-codegen
|
Ref: https://openapi-generator.tech
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
"""Constructor"""
|
"""Constructor"""
|
||||||
# Default Base url
|
# Default Base url
|
||||||
self.host = "https://petstore.swagger.io */ ' \" =end -- \\r\\n \\n \\r/v2 */ ' \" =end -- \\r\\n \\n \\r"
|
self.host = "http://petstore.swagger.io */ ' \" =end -- \\r\\n \\n \\r/v2 */ ' \" =end -- \\r\\n \\n \\r"
|
||||||
# Temp file folder for downloading files
|
# Temp file folder for downloading files
|
||||||
self.temp_folder_path = None
|
self.temp_folder_path = None
|
||||||
|
|
||||||
@@ -134,17 +134,6 @@ class Configuration(six.with_metaclass(TypeWithDefault, object)):
|
|||||||
self.logger_file_handler.setFormatter(self.logger_formatter)
|
self.logger_file_handler.setFormatter(self.logger_formatter)
|
||||||
for _, logger in six.iteritems(self.logger):
|
for _, logger in six.iteritems(self.logger):
|
||||||
logger.addHandler(self.logger_file_handler)
|
logger.addHandler(self.logger_file_handler)
|
||||||
if self.logger_stream_handler:
|
|
||||||
logger.removeHandler(self.logger_stream_handler)
|
|
||||||
else:
|
|
||||||
# If not set logging file,
|
|
||||||
# then add stream handler and remove file handler.
|
|
||||||
self.logger_stream_handler = logging.StreamHandler()
|
|
||||||
self.logger_stream_handler.setFormatter(self.logger_formatter)
|
|
||||||
for _, logger in six.iteritems(self.logger):
|
|
||||||
logger.addHandler(self.logger_stream_handler)
|
|
||||||
if self.logger_file_handler:
|
|
||||||
logger.removeHandler(self.logger_file_handler)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def debug(self):
|
def debug(self):
|
||||||
|
|||||||
@@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
# flake8: noqa
|
# flake8: noqa
|
||||||
"""
|
"""
|
||||||
Swagger Petstore */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
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 -- # noqa: E501
|
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 -- # noqa: E501
|
||||||
|
|
||||||
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Contact: apiteam@swagger.io */ ' \" =end -- \\r\\n \\n \\r
|
Contact: something@something.abc */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
Generated by: https://openapi-generator.tech
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Swagger Petstore */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
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 -- # noqa: E501
|
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 -- # noqa: E501
|
||||||
|
|
||||||
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Contact: apiteam@swagger.io */ ' \" =end -- \\r\\n \\n \\r
|
Contact: something@something.abc */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
Generated by: https://openapi-generator.tech
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@@ -18,19 +18,20 @@ import six
|
|||||||
|
|
||||||
|
|
||||||
class ModelReturn(object):
|
class ModelReturn(object):
|
||||||
"""NOTE: This class is auto generated by the swagger code generator program.
|
"""NOTE: This class is auto generated by OpenAPI Generator.
|
||||||
|
Ref: https://openapi-generator.tech
|
||||||
|
|
||||||
Do not edit the class manually.
|
Do not edit the class manually.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Attributes:
|
Attributes:
|
||||||
swagger_types (dict): The key is attribute name
|
openapi_types (dict): The key is attribute name
|
||||||
and the value is attribute type.
|
and the value is attribute type.
|
||||||
attribute_map (dict): The key is attribute name
|
attribute_map (dict): The key is attribute name
|
||||||
and the value is json key in definition.
|
and the value is json key in definition.
|
||||||
"""
|
"""
|
||||||
swagger_types = {
|
openapi_types = {
|
||||||
'_return': 'int'
|
'_return': 'int'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,7 +40,7 @@ class ModelReturn(object):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, _return=None): # noqa: E501
|
def __init__(self, _return=None): # noqa: E501
|
||||||
"""ModelReturn - a model defined in Swagger""" # noqa: E501
|
"""ModelReturn - a model defined in OpenAPI""" # noqa: E501
|
||||||
|
|
||||||
self.__return = None
|
self.__return = None
|
||||||
self.discriminator = None
|
self.discriminator = None
|
||||||
@@ -74,7 +75,7 @@ class ModelReturn(object):
|
|||||||
"""Returns the model properties as a dict"""
|
"""Returns the model properties as a dict"""
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
for attr, _ in six.iteritems(self.swagger_types):
|
for attr, _ in six.iteritems(self.openapi_types):
|
||||||
value = getattr(self, attr)
|
value = getattr(self, attr)
|
||||||
if isinstance(value, list):
|
if isinstance(value, list):
|
||||||
result[attr] = list(map(
|
result[attr] = list(map(
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Swagger Petstore */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
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 -- # noqa: E501
|
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 -- # noqa: E501
|
||||||
|
|
||||||
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Contact: apiteam@swagger.io */ ' \" =end -- \\r\\n \\n \\r
|
Contact: something@something.abc */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
Generated by: https://openapi-generator.tech
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@@ -27,7 +27,7 @@ from six.moves.urllib.parse import urlencode
|
|||||||
try:
|
try:
|
||||||
import urllib3
|
import urllib3
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise ImportError('Swagger python client requires urllib3.')
|
raise ImportError('OpenAPI Python client requires urllib3.')
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# coding: utf-8
|
# coding: utf-8
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Swagger Petstore */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r
|
||||||
|
|
||||||
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 -- # noqa: E501
|
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 -- # noqa: E501
|
||||||
|
|
||||||
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Contact: apiteam@swagger.io */ ' \" =end -- \\r\\n \\n \\r
|
Contact: something@something.abc */ ' \" =end -- \\r\\n \\n \\r
|
||||||
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
Generated by: https://openapi-generator.tech
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
@@ -27,10 +27,10 @@ REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"]
|
|||||||
setup(
|
setup(
|
||||||
name=NAME,
|
name=NAME,
|
||||||
version=VERSION,
|
version=VERSION,
|
||||||
description="Swagger Petstore */ ' \" =end -- \\r\\n \\n \\r",
|
description="OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r",
|
||||||
author_email="apiteam@swagger.io */ ' \" =end -- \\r\\n \\n \\r",
|
author_email="something@something.abc */ ' \" =end -- \\r\\n \\n \\r",
|
||||||
url="",
|
url="",
|
||||||
keywords=["Swagger", "Swagger Petstore */ ' \" =end -- \\r\\n \\n \\r"],
|
keywords=["OpenAPI", "OpenAPI-Generator", "OpenAPI Petstore */ ' \" =end -- \\r\\n \\n \\r"],
|
||||||
install_requires=REQUIRES,
|
install_requires=REQUIRES,
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ envlist = py27, py3
|
|||||||
[testenv]
|
[testenv]
|
||||||
deps=-r{toxinidir}/requirements.txt
|
deps=-r{toxinidir}/requirements.txt
|
||||||
-r{toxinidir}/test-requirements.txt
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
|
||||||
commands=
|
commands=
|
||||||
nosetests \
|
nosetests \
|
||||||
[]
|
[]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
4.0.0-SNAPSHOT
|
4.0.0-SNAPSHOT
|
||||||
|
|||||||
@@ -488,7 +488,7 @@ No authorization required
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **test_group_parameters**
|
# **test_group_parameters**
|
||||||
> test_group_parameters(string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
||||||
|
|
||||||
Fake endpoint to test group parameters (optional)
|
Fake endpoint to test group parameters (optional)
|
||||||
|
|
||||||
@@ -504,13 +504,16 @@ from pprint import pprint
|
|||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = petstore_api.FakeApi()
|
api_instance = petstore_api.FakeApi()
|
||||||
|
required_string_group = 56 # int | Required String in group parameters
|
||||||
|
required_boolean_group = True # bool | Required Boolean in group parameters
|
||||||
|
required_int64_group = 56 # int | Required Integer in group parameters
|
||||||
string_group = 56 # int | String in group parameters (optional)
|
string_group = 56 # int | String in group parameters (optional)
|
||||||
boolean_group = True # bool | Boolean in group parameters (optional)
|
boolean_group = True # bool | Boolean in group parameters (optional)
|
||||||
int64_group = 56 # int | Integer in group parameters (optional)
|
int64_group = 56 # int | Integer in group parameters (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Fake endpoint to test group parameters (optional)
|
# Fake endpoint to test group parameters (optional)
|
||||||
api_instance.test_group_parameters(string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
|
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
|
||||||
```
|
```
|
||||||
@@ -519,6 +522,9 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**required_string_group** | **int**| Required String in group parameters |
|
||||||
|
**required_boolean_group** | **bool**| Required Boolean in group parameters |
|
||||||
|
**required_int64_group** | **int**| Required Integer in group parameters |
|
||||||
**string_group** | **int**| String in group parameters | [optional]
|
**string_group** | **int**| String in group parameters | [optional]
|
||||||
**boolean_group** | **bool**| Boolean in group parameters | [optional]
|
**boolean_group** | **bool**| Boolean in group parameters | [optional]
|
||||||
**int64_group** | **int**| Integer in group parameters | [optional]
|
**int64_group** | **int**| Integer in group parameters | [optional]
|
||||||
|
|||||||
@@ -1009,16 +1009,19 @@ class FakeApi(object):
|
|||||||
_request_timeout=local_var_params.get('_request_timeout'),
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||||||
collection_formats=collection_formats)
|
collection_formats=collection_formats)
|
||||||
|
|
||||||
def test_group_parameters(self, **kwargs): # noqa: E501
|
def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
|
||||||
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
|
|
||||||
Fake endpoint to test group parameters (optional) # noqa: E501
|
Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please pass async_req=True
|
asynchronous HTTP request, please pass async_req=True
|
||||||
>>> thread = api.test_group_parameters(async_req=True)
|
>>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param async_req bool
|
:param async_req bool
|
||||||
|
:param int required_string_group: Required String in group parameters (required)
|
||||||
|
:param bool required_boolean_group: Required Boolean in group parameters (required)
|
||||||
|
:param int required_int64_group: Required Integer in group parameters (required)
|
||||||
:param int string_group: String in group parameters
|
:param int string_group: String in group parameters
|
||||||
:param bool boolean_group: Boolean in group parameters
|
:param bool boolean_group: Boolean in group parameters
|
||||||
:param int int64_group: Integer in group parameters
|
:param int int64_group: Integer in group parameters
|
||||||
@@ -1028,21 +1031,24 @@ class FakeApi(object):
|
|||||||
"""
|
"""
|
||||||
kwargs['_return_http_data_only'] = True
|
kwargs['_return_http_data_only'] = True
|
||||||
if kwargs.get('async_req'):
|
if kwargs.get('async_req'):
|
||||||
return self.test_group_parameters_with_http_info(**kwargs) # noqa: E501
|
return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501
|
||||||
else:
|
else:
|
||||||
(data) = self.test_group_parameters_with_http_info(**kwargs) # noqa: E501
|
(data) = self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def test_group_parameters_with_http_info(self, **kwargs): # noqa: E501
|
def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
|
||||||
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
|
|
||||||
Fake endpoint to test group parameters (optional) # noqa: E501
|
Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please pass async_req=True
|
asynchronous HTTP request, please pass async_req=True
|
||||||
>>> thread = api.test_group_parameters_with_http_info(async_req=True)
|
>>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param async_req bool
|
:param async_req bool
|
||||||
|
:param int required_string_group: Required String in group parameters (required)
|
||||||
|
:param bool required_boolean_group: Required Boolean in group parameters (required)
|
||||||
|
:param int required_int64_group: Required Integer in group parameters (required)
|
||||||
:param int string_group: String in group parameters
|
:param int string_group: String in group parameters
|
||||||
:param bool boolean_group: Boolean in group parameters
|
:param bool boolean_group: Boolean in group parameters
|
||||||
:param int int64_group: Integer in group parameters
|
:param int int64_group: Integer in group parameters
|
||||||
@@ -1053,7 +1059,7 @@ class FakeApi(object):
|
|||||||
|
|
||||||
local_var_params = locals()
|
local_var_params = locals()
|
||||||
|
|
||||||
all_params = ['string_group', 'boolean_group', 'int64_group'] # noqa: E501
|
all_params = ['required_string_group', 'required_boolean_group', 'required_int64_group', 'string_group', 'boolean_group', 'int64_group'] # noqa: E501
|
||||||
all_params.append('async_req')
|
all_params.append('async_req')
|
||||||
all_params.append('_return_http_data_only')
|
all_params.append('_return_http_data_only')
|
||||||
all_params.append('_preload_content')
|
all_params.append('_preload_content')
|
||||||
@@ -1067,18 +1073,36 @@ class FakeApi(object):
|
|||||||
)
|
)
|
||||||
local_var_params[key] = val
|
local_var_params[key] = val
|
||||||
del local_var_params['kwargs']
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'required_string_group' is set
|
||||||
|
if ('required_string_group' not in local_var_params or
|
||||||
|
local_var_params['required_string_group'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501
|
||||||
|
# verify the required parameter 'required_boolean_group' is set
|
||||||
|
if ('required_boolean_group' not in local_var_params or
|
||||||
|
local_var_params['required_boolean_group'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501
|
||||||
|
# verify the required parameter 'required_int64_group' is set
|
||||||
|
if ('required_int64_group' not in local_var_params or
|
||||||
|
local_var_params['required_int64_group'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501
|
||||||
|
|
||||||
collection_formats = {}
|
collection_formats = {}
|
||||||
|
|
||||||
path_params = {}
|
path_params = {}
|
||||||
|
|
||||||
query_params = []
|
query_params = []
|
||||||
|
if 'required_string_group' in local_var_params:
|
||||||
|
query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501
|
||||||
|
if 'required_int64_group' in local_var_params:
|
||||||
|
query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501
|
||||||
if 'string_group' in local_var_params:
|
if 'string_group' in local_var_params:
|
||||||
query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501
|
query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501
|
||||||
if 'int64_group' in local_var_params:
|
if 'int64_group' in local_var_params:
|
||||||
query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501
|
query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501
|
||||||
|
|
||||||
header_params = {}
|
header_params = {}
|
||||||
|
if 'required_boolean_group' in local_var_params:
|
||||||
|
header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501
|
||||||
if 'boolean_group' in local_var_params:
|
if 'boolean_group' in local_var_params:
|
||||||
header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501
|
header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
4.0.0-SNAPSHOT
|
4.0.0-SNAPSHOT
|
||||||
|
|||||||
@@ -488,7 +488,7 @@ No authorization required
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **test_group_parameters**
|
# **test_group_parameters**
|
||||||
> test_group_parameters(string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
||||||
|
|
||||||
Fake endpoint to test group parameters (optional)
|
Fake endpoint to test group parameters (optional)
|
||||||
|
|
||||||
@@ -504,13 +504,16 @@ from pprint import pprint
|
|||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = petstore_api.FakeApi()
|
api_instance = petstore_api.FakeApi()
|
||||||
|
required_string_group = 56 # int | Required String in group parameters
|
||||||
|
required_boolean_group = True # bool | Required Boolean in group parameters
|
||||||
|
required_int64_group = 56 # int | Required Integer in group parameters
|
||||||
string_group = 56 # int | String in group parameters (optional)
|
string_group = 56 # int | String in group parameters (optional)
|
||||||
boolean_group = True # bool | Boolean in group parameters (optional)
|
boolean_group = True # bool | Boolean in group parameters (optional)
|
||||||
int64_group = 56 # int | Integer in group parameters (optional)
|
int64_group = 56 # int | Integer in group parameters (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Fake endpoint to test group parameters (optional)
|
# Fake endpoint to test group parameters (optional)
|
||||||
api_instance.test_group_parameters(string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
|
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
|
||||||
```
|
```
|
||||||
@@ -519,6 +522,9 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**required_string_group** | **int**| Required String in group parameters |
|
||||||
|
**required_boolean_group** | **bool**| Required Boolean in group parameters |
|
||||||
|
**required_int64_group** | **int**| Required Integer in group parameters |
|
||||||
**string_group** | **int**| String in group parameters | [optional]
|
**string_group** | **int**| String in group parameters | [optional]
|
||||||
**boolean_group** | **bool**| Boolean in group parameters | [optional]
|
**boolean_group** | **bool**| Boolean in group parameters | [optional]
|
||||||
**int64_group** | **int**| Integer in group parameters | [optional]
|
**int64_group** | **int**| Integer in group parameters | [optional]
|
||||||
|
|||||||
@@ -1009,16 +1009,19 @@ class FakeApi(object):
|
|||||||
_request_timeout=local_var_params.get('_request_timeout'),
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||||||
collection_formats=collection_formats)
|
collection_formats=collection_formats)
|
||||||
|
|
||||||
def test_group_parameters(self, **kwargs): # noqa: E501
|
def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
|
||||||
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
|
|
||||||
Fake endpoint to test group parameters (optional) # noqa: E501
|
Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please pass async_req=True
|
asynchronous HTTP request, please pass async_req=True
|
||||||
>>> thread = api.test_group_parameters(async_req=True)
|
>>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param async_req bool
|
:param async_req bool
|
||||||
|
:param int required_string_group: Required String in group parameters (required)
|
||||||
|
:param bool required_boolean_group: Required Boolean in group parameters (required)
|
||||||
|
:param int required_int64_group: Required Integer in group parameters (required)
|
||||||
:param int string_group: String in group parameters
|
:param int string_group: String in group parameters
|
||||||
:param bool boolean_group: Boolean in group parameters
|
:param bool boolean_group: Boolean in group parameters
|
||||||
:param int int64_group: Integer in group parameters
|
:param int int64_group: Integer in group parameters
|
||||||
@@ -1028,21 +1031,24 @@ class FakeApi(object):
|
|||||||
"""
|
"""
|
||||||
kwargs['_return_http_data_only'] = True
|
kwargs['_return_http_data_only'] = True
|
||||||
if kwargs.get('async_req'):
|
if kwargs.get('async_req'):
|
||||||
return self.test_group_parameters_with_http_info(**kwargs) # noqa: E501
|
return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501
|
||||||
else:
|
else:
|
||||||
(data) = self.test_group_parameters_with_http_info(**kwargs) # noqa: E501
|
(data) = self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def test_group_parameters_with_http_info(self, **kwargs): # noqa: E501
|
def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
|
||||||
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
|
|
||||||
Fake endpoint to test group parameters (optional) # noqa: E501
|
Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please pass async_req=True
|
asynchronous HTTP request, please pass async_req=True
|
||||||
>>> thread = api.test_group_parameters_with_http_info(async_req=True)
|
>>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param async_req bool
|
:param async_req bool
|
||||||
|
:param int required_string_group: Required String in group parameters (required)
|
||||||
|
:param bool required_boolean_group: Required Boolean in group parameters (required)
|
||||||
|
:param int required_int64_group: Required Integer in group parameters (required)
|
||||||
:param int string_group: String in group parameters
|
:param int string_group: String in group parameters
|
||||||
:param bool boolean_group: Boolean in group parameters
|
:param bool boolean_group: Boolean in group parameters
|
||||||
:param int int64_group: Integer in group parameters
|
:param int int64_group: Integer in group parameters
|
||||||
@@ -1053,7 +1059,7 @@ class FakeApi(object):
|
|||||||
|
|
||||||
local_var_params = locals()
|
local_var_params = locals()
|
||||||
|
|
||||||
all_params = ['string_group', 'boolean_group', 'int64_group'] # noqa: E501
|
all_params = ['required_string_group', 'required_boolean_group', 'required_int64_group', 'string_group', 'boolean_group', 'int64_group'] # noqa: E501
|
||||||
all_params.append('async_req')
|
all_params.append('async_req')
|
||||||
all_params.append('_return_http_data_only')
|
all_params.append('_return_http_data_only')
|
||||||
all_params.append('_preload_content')
|
all_params.append('_preload_content')
|
||||||
@@ -1067,18 +1073,36 @@ class FakeApi(object):
|
|||||||
)
|
)
|
||||||
local_var_params[key] = val
|
local_var_params[key] = val
|
||||||
del local_var_params['kwargs']
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'required_string_group' is set
|
||||||
|
if ('required_string_group' not in local_var_params or
|
||||||
|
local_var_params['required_string_group'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501
|
||||||
|
# verify the required parameter 'required_boolean_group' is set
|
||||||
|
if ('required_boolean_group' not in local_var_params or
|
||||||
|
local_var_params['required_boolean_group'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501
|
||||||
|
# verify the required parameter 'required_int64_group' is set
|
||||||
|
if ('required_int64_group' not in local_var_params or
|
||||||
|
local_var_params['required_int64_group'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501
|
||||||
|
|
||||||
collection_formats = {}
|
collection_formats = {}
|
||||||
|
|
||||||
path_params = {}
|
path_params = {}
|
||||||
|
|
||||||
query_params = []
|
query_params = []
|
||||||
|
if 'required_string_group' in local_var_params:
|
||||||
|
query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501
|
||||||
|
if 'required_int64_group' in local_var_params:
|
||||||
|
query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501
|
||||||
if 'string_group' in local_var_params:
|
if 'string_group' in local_var_params:
|
||||||
query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501
|
query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501
|
||||||
if 'int64_group' in local_var_params:
|
if 'int64_group' in local_var_params:
|
||||||
query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501
|
query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501
|
||||||
|
|
||||||
header_params = {}
|
header_params = {}
|
||||||
|
if 'required_boolean_group' in local_var_params:
|
||||||
|
header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501
|
||||||
if 'boolean_group' in local_var_params:
|
if 'boolean_group' in local_var_params:
|
||||||
header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501
|
header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
4.0.0-SNAPSHOT
|
4.0.0-SNAPSHOT
|
||||||
|
|||||||
@@ -488,7 +488,7 @@ No authorization required
|
|||||||
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
||||||
|
|
||||||
# **test_group_parameters**
|
# **test_group_parameters**
|
||||||
> test_group_parameters(string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
> test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
||||||
|
|
||||||
Fake endpoint to test group parameters (optional)
|
Fake endpoint to test group parameters (optional)
|
||||||
|
|
||||||
@@ -504,13 +504,16 @@ from pprint import pprint
|
|||||||
|
|
||||||
# create an instance of the API class
|
# create an instance of the API class
|
||||||
api_instance = petstore_api.FakeApi()
|
api_instance = petstore_api.FakeApi()
|
||||||
|
required_string_group = 56 # int | Required String in group parameters
|
||||||
|
required_boolean_group = True # bool | Required Boolean in group parameters
|
||||||
|
required_int64_group = 56 # int | Required Integer in group parameters
|
||||||
string_group = 56 # int | String in group parameters (optional)
|
string_group = 56 # int | String in group parameters (optional)
|
||||||
boolean_group = True # bool | Boolean in group parameters (optional)
|
boolean_group = True # bool | Boolean in group parameters (optional)
|
||||||
int64_group = 56 # int | Integer in group parameters (optional)
|
int64_group = 56 # int | Integer in group parameters (optional)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Fake endpoint to test group parameters (optional)
|
# Fake endpoint to test group parameters (optional)
|
||||||
api_instance.test_group_parameters(string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
api_instance.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, string_group=string_group, boolean_group=boolean_group, int64_group=int64_group)
|
||||||
except ApiException as e:
|
except ApiException as e:
|
||||||
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
|
print("Exception when calling FakeApi->test_group_parameters: %s\n" % e)
|
||||||
```
|
```
|
||||||
@@ -519,6 +522,9 @@ except ApiException as e:
|
|||||||
|
|
||||||
Name | Type | Description | Notes
|
Name | Type | Description | Notes
|
||||||
------------- | ------------- | ------------- | -------------
|
------------- | ------------- | ------------- | -------------
|
||||||
|
**required_string_group** | **int**| Required String in group parameters |
|
||||||
|
**required_boolean_group** | **bool**| Required Boolean in group parameters |
|
||||||
|
**required_int64_group** | **int**| Required Integer in group parameters |
|
||||||
**string_group** | **int**| String in group parameters | [optional]
|
**string_group** | **int**| String in group parameters | [optional]
|
||||||
**boolean_group** | **bool**| Boolean in group parameters | [optional]
|
**boolean_group** | **bool**| Boolean in group parameters | [optional]
|
||||||
**int64_group** | **int**| Integer in group parameters | [optional]
|
**int64_group** | **int**| Integer in group parameters | [optional]
|
||||||
|
|||||||
@@ -1009,16 +1009,19 @@ class FakeApi(object):
|
|||||||
_request_timeout=local_var_params.get('_request_timeout'),
|
_request_timeout=local_var_params.get('_request_timeout'),
|
||||||
collection_formats=collection_formats)
|
collection_formats=collection_formats)
|
||||||
|
|
||||||
def test_group_parameters(self, **kwargs): # noqa: E501
|
def test_group_parameters(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
|
||||||
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
|
|
||||||
Fake endpoint to test group parameters (optional) # noqa: E501
|
Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please pass async_req=True
|
asynchronous HTTP request, please pass async_req=True
|
||||||
>>> thread = api.test_group_parameters(async_req=True)
|
>>> thread = api.test_group_parameters(required_string_group, required_boolean_group, required_int64_group, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param async_req bool
|
:param async_req bool
|
||||||
|
:param int required_string_group: Required String in group parameters (required)
|
||||||
|
:param bool required_boolean_group: Required Boolean in group parameters (required)
|
||||||
|
:param int required_int64_group: Required Integer in group parameters (required)
|
||||||
:param int string_group: String in group parameters
|
:param int string_group: String in group parameters
|
||||||
:param bool boolean_group: Boolean in group parameters
|
:param bool boolean_group: Boolean in group parameters
|
||||||
:param int int64_group: Integer in group parameters
|
:param int int64_group: Integer in group parameters
|
||||||
@@ -1028,21 +1031,24 @@ class FakeApi(object):
|
|||||||
"""
|
"""
|
||||||
kwargs['_return_http_data_only'] = True
|
kwargs['_return_http_data_only'] = True
|
||||||
if kwargs.get('async_req'):
|
if kwargs.get('async_req'):
|
||||||
return self.test_group_parameters_with_http_info(**kwargs) # noqa: E501
|
return self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501
|
||||||
else:
|
else:
|
||||||
(data) = self.test_group_parameters_with_http_info(**kwargs) # noqa: E501
|
(data) = self.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, **kwargs) # noqa: E501
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def test_group_parameters_with_http_info(self, **kwargs): # noqa: E501
|
def test_group_parameters_with_http_info(self, required_string_group, required_boolean_group, required_int64_group, **kwargs): # noqa: E501
|
||||||
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
"""Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
|
|
||||||
Fake endpoint to test group parameters (optional) # noqa: E501
|
Fake endpoint to test group parameters (optional) # noqa: E501
|
||||||
This method makes a synchronous HTTP request by default. To make an
|
This method makes a synchronous HTTP request by default. To make an
|
||||||
asynchronous HTTP request, please pass async_req=True
|
asynchronous HTTP request, please pass async_req=True
|
||||||
>>> thread = api.test_group_parameters_with_http_info(async_req=True)
|
>>> thread = api.test_group_parameters_with_http_info(required_string_group, required_boolean_group, required_int64_group, async_req=True)
|
||||||
>>> result = thread.get()
|
>>> result = thread.get()
|
||||||
|
|
||||||
:param async_req bool
|
:param async_req bool
|
||||||
|
:param int required_string_group: Required String in group parameters (required)
|
||||||
|
:param bool required_boolean_group: Required Boolean in group parameters (required)
|
||||||
|
:param int required_int64_group: Required Integer in group parameters (required)
|
||||||
:param int string_group: String in group parameters
|
:param int string_group: String in group parameters
|
||||||
:param bool boolean_group: Boolean in group parameters
|
:param bool boolean_group: Boolean in group parameters
|
||||||
:param int int64_group: Integer in group parameters
|
:param int int64_group: Integer in group parameters
|
||||||
@@ -1053,7 +1059,7 @@ class FakeApi(object):
|
|||||||
|
|
||||||
local_var_params = locals()
|
local_var_params = locals()
|
||||||
|
|
||||||
all_params = ['string_group', 'boolean_group', 'int64_group'] # noqa: E501
|
all_params = ['required_string_group', 'required_boolean_group', 'required_int64_group', 'string_group', 'boolean_group', 'int64_group'] # noqa: E501
|
||||||
all_params.append('async_req')
|
all_params.append('async_req')
|
||||||
all_params.append('_return_http_data_only')
|
all_params.append('_return_http_data_only')
|
||||||
all_params.append('_preload_content')
|
all_params.append('_preload_content')
|
||||||
@@ -1067,18 +1073,36 @@ class FakeApi(object):
|
|||||||
)
|
)
|
||||||
local_var_params[key] = val
|
local_var_params[key] = val
|
||||||
del local_var_params['kwargs']
|
del local_var_params['kwargs']
|
||||||
|
# verify the required parameter 'required_string_group' is set
|
||||||
|
if ('required_string_group' not in local_var_params or
|
||||||
|
local_var_params['required_string_group'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `required_string_group` when calling `test_group_parameters`") # noqa: E501
|
||||||
|
# verify the required parameter 'required_boolean_group' is set
|
||||||
|
if ('required_boolean_group' not in local_var_params or
|
||||||
|
local_var_params['required_boolean_group'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `required_boolean_group` when calling `test_group_parameters`") # noqa: E501
|
||||||
|
# verify the required parameter 'required_int64_group' is set
|
||||||
|
if ('required_int64_group' not in local_var_params or
|
||||||
|
local_var_params['required_int64_group'] is None):
|
||||||
|
raise ValueError("Missing the required parameter `required_int64_group` when calling `test_group_parameters`") # noqa: E501
|
||||||
|
|
||||||
collection_formats = {}
|
collection_formats = {}
|
||||||
|
|
||||||
path_params = {}
|
path_params = {}
|
||||||
|
|
||||||
query_params = []
|
query_params = []
|
||||||
|
if 'required_string_group' in local_var_params:
|
||||||
|
query_params.append(('required_string_group', local_var_params['required_string_group'])) # noqa: E501
|
||||||
|
if 'required_int64_group' in local_var_params:
|
||||||
|
query_params.append(('required_int64_group', local_var_params['required_int64_group'])) # noqa: E501
|
||||||
if 'string_group' in local_var_params:
|
if 'string_group' in local_var_params:
|
||||||
query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501
|
query_params.append(('string_group', local_var_params['string_group'])) # noqa: E501
|
||||||
if 'int64_group' in local_var_params:
|
if 'int64_group' in local_var_params:
|
||||||
query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501
|
query_params.append(('int64_group', local_var_params['int64_group'])) # noqa: E501
|
||||||
|
|
||||||
header_params = {}
|
header_params = {}
|
||||||
|
if 'required_boolean_group' in local_var_params:
|
||||||
|
header_params['required_boolean_group'] = local_var_params['required_boolean_group'] # noqa: E501
|
||||||
if 'boolean_group' in local_var_params:
|
if 'boolean_group' in local_var_params:
|
||||||
header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501
|
header_params['boolean_group'] = local_var_params['boolean_group'] # noqa: E501
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user