From 3fa218f9883fb003b879df58417ce6a9c6a77dc6 Mon Sep 17 00:00:00 2001 From: fullcircle23 Date: Wed, 27 May 2020 17:13:08 +0800 Subject: [PATCH 1/5] [python][client] Fix delimiter collision (#5981) --- .../codegen/languages/PythonClientCodegen.java | 6 ++++-- .../codegen/python/PythonClientCodegenTest.java | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index ef92f7ce0db4..e8df9d1b8ca5 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -684,7 +684,8 @@ public String toDefaultValue(Schema p) { if (Pattern.compile("\r\n|\r|\n").matcher((String) p.getDefault()).find()) return "'''" + p.getDefault() + "'''"; else - return "'" + ((String) p.getDefault()).replaceAll("'", "\'") + "'"; + // wrap using double quotes to avoid the need to escape any embedded single quotes + return "\"" + p.getDefault() + "\""; } } else if (ModelUtils.isArraySchema(p)) { if (p.getDefault() != null) { @@ -728,7 +729,8 @@ private String toExampleValueRecursive(Schema schema, List included_sche if (StringUtils.isNotBlank(example) && !"null".equals(example)) { if (ModelUtils.isStringSchema(schema)) { - example = "'" + example + "'"; + // wrap using double quotes to avoid the need to escape any embedded single quotes + example = "\"" + example + "\""; } return example; } diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java index 565e6848f64b..3c2544edf91e 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java @@ -93,12 +93,21 @@ public void testRegularExpressionOpenAPISchemaVersion3() { Assert.assertEquals(op.allParams.get(5).pattern, "/^pattern\\d{3}$/i"); } - @Test(description = "test single quotes escape") - public void testSingleQuotes() { + @Test(description = "test default value with single quotes") + public void testSingleQuotesDefaultValue() { final PythonClientCodegen codegen = new PythonClientCodegen(); StringSchema schema = new StringSchema(); schema.setDefault("Text containing 'single' quote"); String defaultValue = codegen.toDefaultValue(schema); - Assert.assertEquals("'Text containing \'single\' quote'", defaultValue); + Assert.assertEquals(defaultValue, "\"Text containing 'single' quote\""); + } + + @Test(description = "test example value with single quotes") + public void testSingleQuotesExampleValue() { + final PythonClientCodegen codegen = new PythonClientCodegen(); + StringSchema schema = new StringSchema(); + schema.setExample("Text containing 'single' quote"); + String exampleValue = codegen.toExampleValue(schema); + Assert.assertEquals(exampleValue, "\"Text containing 'single' quote\""); } } From 4ccd3fcefb6be0fed0c0f22814b54dadcf59baf9 Mon Sep 17 00:00:00 2001 From: fullcircle23 Date: Wed, 27 May 2020 17:27:10 +0800 Subject: [PATCH 2/5] [python][client] Fix delimiter collision (#5981) update samples --- .../petstore/python-asyncio/docs/Animal.md | 2 +- .../petstore/python-asyncio/docs/Category.md | 2 +- .../petstore/python-asyncio/docs/FakeApi.md | 16 ++++++++-------- .../python-asyncio/docs/TypeHolderDefault.md | 2 +- .../python-asyncio/petstore_api/models/animal.py | 2 +- .../petstore_api/models/category.py | 2 +- .../petstore_api/models/type_holder_default.py | 2 +- .../petstore/python-tornado/docs/Animal.md | 2 +- .../petstore/python-tornado/docs/Category.md | 2 +- .../petstore/python-tornado/docs/FakeApi.md | 16 ++++++++-------- .../python-tornado/docs/TypeHolderDefault.md | 2 +- .../python-tornado/petstore_api/models/animal.py | 2 +- .../petstore_api/models/category.py | 2 +- .../petstore_api/models/type_holder_default.py | 2 +- samples/client/petstore/python/docs/Animal.md | 2 +- samples/client/petstore/python/docs/Category.md | 2 +- samples/client/petstore/python/docs/FakeApi.md | 16 ++++++++-------- .../petstore/python/docs/TypeHolderDefault.md | 2 +- .../python/petstore_api/models/animal.py | 2 +- .../python/petstore_api/models/category.py | 2 +- .../petstore_api/models/type_holder_default.py | 2 +- 21 files changed, 42 insertions(+), 42 deletions(-) diff --git a/samples/client/petstore/python-asyncio/docs/Animal.md b/samples/client/petstore/python-asyncio/docs/Animal.md index 7ed4ba541fa3..d9a9be5bfe66 100644 --- a/samples/client/petstore/python-asyncio/docs/Animal.md +++ b/samples/client/petstore/python-asyncio/docs/Animal.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | -**color** | **str** | | [optional] [default to 'red'] +**color** | **str** | | [optional] [default to "red"] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-asyncio/docs/Category.md b/samples/client/petstore/python-asyncio/docs/Category.md index 7e5c1e316499..e6f8efaf2f54 100644 --- a/samples/client/petstore/python-asyncio/docs/Category.md +++ b/samples/client/petstore/python-asyncio/docs/Category.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] -**name** | **str** | | [default to 'default-name'] +**name** | **str** | | [default to "default-name"] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md index 68a36b5f7525..07d13239ed98 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/FakeApi.md @@ -633,13 +633,13 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') +enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) (default to "-efg") enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') +enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) (default to "-efg") enum_query_integer = 56 # int | Query parameter enum test (double) (optional) enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') -enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') +enum_form_string_array = "$" # list[str] | Form parameter enum test (string array) (optional) (default to "$") +enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) (default to "-efg") try: # To test enum parameters @@ -653,13 +653,13 @@ enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) ( Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to "-efg"] **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to "-efg"] **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] + **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to "$"] + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to "-efg"] ### Return type diff --git a/samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md b/samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md index 861da021826a..7a8b80eb8f8a 100644 --- a/samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md +++ b/samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**string_item** | **str** | | [default to 'what'] +**string_item** | **str** | | [default to "what"] **number_item** | **float** | | **integer_item** | **int** | | **bool_item** | **bool** | | [default to True] diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/animal.py b/samples/client/petstore/python-asyncio/petstore_api/models/animal.py index b338e0eb18e9..859c7b2e5e3f 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/animal.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/animal.py @@ -48,7 +48,7 @@ class Animal(object): 'BigCat': 'BigCat' } - def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 + def __init__(self, class_name=None, color="red", local_vars_configuration=None): # noqa: E501 """Animal - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/category.py b/samples/client/petstore/python-asyncio/petstore_api/models/category.py index b47c148953ea..95e1b8312d3f 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/category.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/category.py @@ -42,7 +42,7 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 + def __init__(self, id=None, name="default-name", local_vars_configuration=None): # noqa: E501 """Category - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py index 8163ea77aa73..dc94e639eac2 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py @@ -48,7 +48,7 @@ class TypeHolderDefault(object): 'array_item': 'array_item' } - def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, string_item="what", number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python-tornado/docs/Animal.md b/samples/client/petstore/python-tornado/docs/Animal.md index 7ed4ba541fa3..d9a9be5bfe66 100644 --- a/samples/client/petstore/python-tornado/docs/Animal.md +++ b/samples/client/petstore/python-tornado/docs/Animal.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | -**color** | **str** | | [optional] [default to 'red'] +**color** | **str** | | [optional] [default to "red"] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-tornado/docs/Category.md b/samples/client/petstore/python-tornado/docs/Category.md index 7e5c1e316499..e6f8efaf2f54 100644 --- a/samples/client/petstore/python-tornado/docs/Category.md +++ b/samples/client/petstore/python-tornado/docs/Category.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] -**name** | **str** | | [default to 'default-name'] +**name** | **str** | | [default to "default-name"] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md index 68a36b5f7525..07d13239ed98 100644 --- a/samples/client/petstore/python-tornado/docs/FakeApi.md +++ b/samples/client/petstore/python-tornado/docs/FakeApi.md @@ -633,13 +633,13 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') +enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) (default to "-efg") enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') +enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) (default to "-efg") enum_query_integer = 56 # int | Query parameter enum test (double) (optional) enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') -enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') +enum_form_string_array = "$" # list[str] | Form parameter enum test (string array) (optional) (default to "$") +enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) (default to "-efg") try: # To test enum parameters @@ -653,13 +653,13 @@ enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) ( Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to "-efg"] **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to "-efg"] **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] + **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to "$"] + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to "-efg"] ### Return type diff --git a/samples/client/petstore/python-tornado/docs/TypeHolderDefault.md b/samples/client/petstore/python-tornado/docs/TypeHolderDefault.md index 861da021826a..7a8b80eb8f8a 100644 --- a/samples/client/petstore/python-tornado/docs/TypeHolderDefault.md +++ b/samples/client/petstore/python-tornado/docs/TypeHolderDefault.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**string_item** | **str** | | [default to 'what'] +**string_item** | **str** | | [default to "what"] **number_item** | **float** | | **integer_item** | **int** | | **bool_item** | **bool** | | [default to True] diff --git a/samples/client/petstore/python-tornado/petstore_api/models/animal.py b/samples/client/petstore/python-tornado/petstore_api/models/animal.py index b338e0eb18e9..859c7b2e5e3f 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/animal.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/animal.py @@ -48,7 +48,7 @@ class Animal(object): 'BigCat': 'BigCat' } - def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 + def __init__(self, class_name=None, color="red", local_vars_configuration=None): # noqa: E501 """Animal - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/category.py b/samples/client/petstore/python-tornado/petstore_api/models/category.py index b47c148953ea..95e1b8312d3f 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/category.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/category.py @@ -42,7 +42,7 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 + def __init__(self, id=None, name="default-name", local_vars_configuration=None): # noqa: E501 """Category - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py index 8163ea77aa73..dc94e639eac2 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py @@ -48,7 +48,7 @@ class TypeHolderDefault(object): 'array_item': 'array_item' } - def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, string_item="what", number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python/docs/Animal.md b/samples/client/petstore/python/docs/Animal.md index 7ed4ba541fa3..d9a9be5bfe66 100644 --- a/samples/client/petstore/python/docs/Animal.md +++ b/samples/client/petstore/python/docs/Animal.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | -**color** | **str** | | [optional] [default to 'red'] +**color** | **str** | | [optional] [default to "red"] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Category.md b/samples/client/petstore/python/docs/Category.md index 7e5c1e316499..e6f8efaf2f54 100644 --- a/samples/client/petstore/python/docs/Category.md +++ b/samples/client/petstore/python/docs/Category.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] -**name** | **str** | | [default to 'default-name'] +**name** | **str** | | [default to "default-name"] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index 68a36b5f7525..07d13239ed98 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -633,13 +633,13 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') +enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) (default to "-efg") enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') +enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) (default to "-efg") enum_query_integer = 56 # int | Query parameter enum test (double) (optional) enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') -enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') +enum_form_string_array = "$" # list[str] | Form parameter enum test (string array) (optional) (default to "$") +enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) (default to "-efg") try: # To test enum parameters @@ -653,13 +653,13 @@ enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) ( Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to "-efg"] **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to "-efg"] **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] + **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to "$"] + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to "-efg"] ### Return type diff --git a/samples/client/petstore/python/docs/TypeHolderDefault.md b/samples/client/petstore/python/docs/TypeHolderDefault.md index 861da021826a..7a8b80eb8f8a 100644 --- a/samples/client/petstore/python/docs/TypeHolderDefault.md +++ b/samples/client/petstore/python/docs/TypeHolderDefault.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**string_item** | **str** | | [default to 'what'] +**string_item** | **str** | | [default to "what"] **number_item** | **float** | | **integer_item** | **int** | | **bool_item** | **bool** | | [default to True] diff --git a/samples/client/petstore/python/petstore_api/models/animal.py b/samples/client/petstore/python/petstore_api/models/animal.py index b338e0eb18e9..859c7b2e5e3f 100644 --- a/samples/client/petstore/python/petstore_api/models/animal.py +++ b/samples/client/petstore/python/petstore_api/models/animal.py @@ -48,7 +48,7 @@ class Animal(object): 'BigCat': 'BigCat' } - def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 + def __init__(self, class_name=None, color="red", local_vars_configuration=None): # noqa: E501 """Animal - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python/petstore_api/models/category.py b/samples/client/petstore/python/petstore_api/models/category.py index b47c148953ea..95e1b8312d3f 100644 --- a/samples/client/petstore/python/petstore_api/models/category.py +++ b/samples/client/petstore/python/petstore_api/models/category.py @@ -42,7 +42,7 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 + def __init__(self, id=None, name="default-name", local_vars_configuration=None): # noqa: E501 """Category - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python/petstore_api/models/type_holder_default.py b/samples/client/petstore/python/petstore_api/models/type_holder_default.py index 8163ea77aa73..dc94e639eac2 100644 --- a/samples/client/petstore/python/petstore_api/models/type_holder_default.py +++ b/samples/client/petstore/python/petstore_api/models/type_holder_default.py @@ -48,7 +48,7 @@ class TypeHolderDefault(object): 'array_item': 'array_item' } - def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, string_item="what", number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() From c3dbb421e5a61077447f9d5e622a2cff4503838e Mon Sep 17 00:00:00 2001 From: fullcircle23 Date: Wed, 27 May 2020 17:28:21 +0800 Subject: [PATCH 3/5] [python][client] Fix delimiter collision (#5981) update samples --- .../client/petstore/python/docs/Animal.md | 2 +- .../client/petstore/python/docs/Category.md | 2 +- .../client/petstore/python/docs/FakeApi.md | 16 ++++++++-------- .../openapi3/client/petstore/python/docs/Foo.md | 2 +- .../client/petstore/python/docs/InlineObject2.md | 2 +- .../python/petstore_api/models/animal.py | 2 +- .../python/petstore_api/models/category.py | 2 +- .../petstore/python/petstore_api/models/foo.py | 2 +- .../python/petstore_api/models/inline_object2.py | 2 +- 9 files changed, 16 insertions(+), 16 deletions(-) diff --git a/samples/openapi3/client/petstore/python/docs/Animal.md b/samples/openapi3/client/petstore/python/docs/Animal.md index 7ed4ba541fa3..d9a9be5bfe66 100644 --- a/samples/openapi3/client/petstore/python/docs/Animal.md +++ b/samples/openapi3/client/petstore/python/docs/Animal.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | -**color** | **str** | | [optional] [default to 'red'] +**color** | **str** | | [optional] [default to "red"] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Category.md b/samples/openapi3/client/petstore/python/docs/Category.md index 7e5c1e316499..e6f8efaf2f54 100644 --- a/samples/openapi3/client/petstore/python/docs/Category.md +++ b/samples/openapi3/client/petstore/python/docs/Category.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] -**name** | **str** | | [default to 'default-name'] +**name** | **str** | | [default to "default-name"] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index 50de8cc758fa..c57a587d893b 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -756,13 +756,13 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') +enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) (default to "-efg") enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') +enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) (default to "-efg") enum_query_integer = 56 # int | Query parameter enum test (double) (optional) enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') -enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') +enum_form_string_array = "$" # list[str] | Form parameter enum test (string array) (optional) (default to "$") +enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) (default to "-efg") try: # To test enum parameters @@ -776,13 +776,13 @@ enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) ( Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to "-efg"] **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to "-efg"] **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] + **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to "$"] + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to "-efg"] ### Return type diff --git a/samples/openapi3/client/petstore/python/docs/Foo.md b/samples/openapi3/client/petstore/python/docs/Foo.md index c55aa2cf103c..e895b805e2e7 100644 --- a/samples/openapi3/client/petstore/python/docs/Foo.md +++ b/samples/openapi3/client/petstore/python/docs/Foo.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [default to 'bar'] +**bar** | **str** | | [optional] [default to "bar"] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject2.md b/samples/openapi3/client/petstore/python/docs/InlineObject2.md index 9bfba12f6f15..342f90eaa759 100644 --- a/samples/openapi3/client/petstore/python/docs/InlineObject2.md +++ b/samples/openapi3/client/petstore/python/docs/InlineObject2.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enum_form_string_array** | **list[str]** | Form parameter enum test (string array) | [optional] -**enum_form_string** | **str** | Form parameter enum test (string) | [optional] [default to '-efg'] +**enum_form_string** | **str** | Form parameter enum test (string) | [optional] [default to Enum_form_stringEnum._EFG] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py index 65cef1a60885..be6372cac4e5 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -47,7 +47,7 @@ class Animal(object): 'Cat': 'Cat' } - def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 + def __init__(self, class_name=None, color="red", local_vars_configuration=None): # noqa: E501 """Animal - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/category.py b/samples/openapi3/client/petstore/python/petstore_api/models/category.py index b47c148953ea..95e1b8312d3f 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/category.py @@ -42,7 +42,7 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 + def __init__(self, id=None, name="default-name", local_vars_configuration=None): # noqa: E501 """Category - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py index 0a98b8837cac..74ebca1bb2ac 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py @@ -40,7 +40,7 @@ class Foo(object): 'bar': 'bar' } - def __init__(self, bar='bar', local_vars_configuration=None): # noqa: E501 + def __init__(self, bar="bar", local_vars_configuration=None): # noqa: E501 """Foo - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py index f904d0a24d5d..5b250b86ea11 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py @@ -42,7 +42,7 @@ class InlineObject2(object): 'enum_form_string': 'enum_form_string' } - def __init__(self, enum_form_string_array=None, enum_form_string='-efg', local_vars_configuration=None): # noqa: E501 + def __init__(self, enum_form_string_array=None, enum_form_string=Enum_form_stringEnum._EFG, local_vars_configuration=None): # noqa: E501 """InlineObject2 - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() From 0acd69a424f433067e7dc573339895159f7afad4 Mon Sep 17 00:00:00 2001 From: fullcircle23 Date: Thu, 28 May 2020 15:24:45 +0800 Subject: [PATCH 4/5] [python][client] Fix convert to enum var name (#5981) --- .../languages/PythonClientCodegen.java | 39 +++++---- .../python/PythonClientCodegenTest.java | 84 +++++++++++++++++++ 2 files changed, 106 insertions(+), 17 deletions(-) diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java index e8df9d1b8ca5..21617e5c47c2 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/PythonClientCodegen.java @@ -683,9 +683,12 @@ public String toDefaultValue(Schema p) { if (p.getDefault() != null) { if (Pattern.compile("\r\n|\r|\n").matcher((String) p.getDefault()).find()) return "'''" + p.getDefault() + "'''"; - else + else if (p.getEnum() == null) // wrap using double quotes to avoid the need to escape any embedded single quotes return "\"" + p.getDefault() + "\""; + else + // convert to enum var name later in postProcessModels + return (String) p.getDefault(); } } else if (ModelUtils.isArraySchema(p)) { if (p.getDefault() != null) { @@ -904,43 +907,45 @@ public void setParameterExampleValue(CodegenParameter p) { type = p.dataType; } - if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) { + if (type != null) { + if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) { if (example == null) { - example = p.paramName + "_example"; + example = p.paramName + "_example"; } example = "'" + escapeText(example) + "'"; - } else if ("Integer".equals(type) || "int".equals(type)) { + } else if ("Integer".equals(type) || "int".equals(type)) { if (example == null) { - example = "56"; + example = "56"; } - } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) { + } else if ("Float".equalsIgnoreCase(type) || "Double".equalsIgnoreCase(type)) { if (example == null) { - example = "3.4"; + example = "3.4"; } - } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) { + } else if ("BOOLEAN".equalsIgnoreCase(type) || "bool".equalsIgnoreCase(type)) { if (example == null) { - example = "True"; + example = "True"; } - } else if ("file".equalsIgnoreCase(type)) { + } else if ("file".equalsIgnoreCase(type)) { if (example == null) { - example = "/path/to/file"; + example = "/path/to/file"; } example = "'" + escapeText(example) + "'"; - } else if ("Date".equalsIgnoreCase(type)) { + } else if ("Date".equalsIgnoreCase(type)) { if (example == null) { - example = "2013-10-20"; + example = "2013-10-20"; } example = "'" + escapeText(example) + "'"; - } else if ("DateTime".equalsIgnoreCase(type)) { + } else if ("DateTime".equalsIgnoreCase(type)) { if (example == null) { - example = "2013-10-20T19:20:30+01:00"; + example = "2013-10-20T19:20:30+01:00"; } example = "'" + escapeText(example) + "'"; - } else if (!languageSpecificPrimitives.contains(type)) { + } else if (!languageSpecificPrimitives.contains(type)) { // type is a model class, e.g. User example = this.packageName + "." + type + "()"; - } else { + } else { LOGGER.warn("Type " + type + " not handled properly in setParameterExampleValue"); + } } if (example == null) { diff --git a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java index 3c2544edf91e..687a04ec3acf 100644 --- a/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java +++ b/modules/openapi-generator/src/test/java/org/openapitools/codegen/python/PythonClientCodegenTest.java @@ -19,11 +19,17 @@ import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.Operation; +import io.swagger.v3.oas.models.media.Schema; import io.swagger.v3.oas.models.media.StringSchema; +import java.util.HashSet; import org.openapitools.codegen.CodegenConstants; +import org.openapitools.codegen.CodegenModelFactory; +import org.openapitools.codegen.CodegenModelType; import org.openapitools.codegen.CodegenOperation; +import org.openapitools.codegen.CodegenParameter; import org.openapitools.codegen.TestUtils; import org.openapitools.codegen.languages.PythonClientCodegen; +import org.openapitools.codegen.utils.ModelUtils; import org.testng.Assert; import org.testng.annotations.Test; @@ -110,4 +116,82 @@ public void testSingleQuotesExampleValue() { String exampleValue = codegen.toExampleValue(schema); Assert.assertEquals(exampleValue, "\"Text containing 'single' quote\""); } + + @Test + public void testFormParameterHasDefaultValue() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + codegen.setOpenAPI(openAPI); + + Schema requestBodySchema = ModelUtils.getSchemaFromRequestBody(openAPI.getPaths().get("/fake").getGet().getRequestBody()); + CodegenParameter codegenParameter = codegen.fromFormProperty("enum_form_string", (Schema) requestBodySchema.getProperties().get("enum_form_string"), new HashSet()); + + Assert.assertEquals(codegenParameter.defaultValue, "-efg"); + } + + @Test + public void testExample1() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + + Operation operation = openAPI.getPaths().get("/example1/singular").getGet(); + CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); + + Assert.assertEquals(codegenParameter.example, "example1 value"); + + Operation operation2 = openAPI.getPaths().get("/example1/plural").getGet(); + CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter2, operation2.getParameters().get(0)); + + Assert.assertEquals(codegenParameter2.example, "An example1 value"); + } + + @Test + public void testExample2() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + + Operation operation = openAPI.getPaths().get("/example2/singular").getGet(); + CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); + + Assert.assertEquals(codegenParameter.example, "example2 value"); + } + + @Test + public void testExample3() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + + Operation operation = openAPI.getPaths().get("/example3/singular").getGet(); + CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter, operation.getParameters().get(0)); + + Assert.assertEquals(codegenParameter.example, "example3: parameter value"); + + Operation operation2 = openAPI.getPaths().get("/example3/plural").getGet(); + CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter2, operation2.getParameters().get(0)); + + Assert.assertEquals(codegenParameter2.example, "example3: parameter value"); + } + + @Test + public void testExample4() { + final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/examples.yaml"); + final PythonClientCodegen codegen = new PythonClientCodegen(); + + Operation operation = openAPI.getPaths().get("/example4/singular").getPost(); + CodegenParameter codegenParameter = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter, operation.getRequestBody()); + + Assert.assertEquals(codegenParameter.example, "example4 value"); + + Operation operation2 = openAPI.getPaths().get("/example4/plural").getPost(); + CodegenParameter codegenParameter2 = CodegenModelFactory.newInstance(CodegenModelType.PARAMETER); + codegen.setParameterExampleValue(codegenParameter2, operation2.getRequestBody()); + + Assert.assertEquals(codegenParameter2.example, "An example4 value"); + } } From 8e87228b0b6defacb0c9fb782f98674927d875cb Mon Sep 17 00:00:00 2001 From: fullcircle23 Date: Thu, 28 May 2020 15:25:56 +0800 Subject: [PATCH 5/5] [python][client] Fix convert to enum var name (#5981) update samples --- .../petstore/python-asyncio/docs/Animal.md | 2 +- .../petstore/python-asyncio/docs/Category.md | 2 +- .../petstore/python-asyncio/docs/FakeApi.md | 16 ++++++++-------- .../python-asyncio/docs/TypeHolderDefault.md | 2 +- .../python-asyncio/petstore_api/models/animal.py | 2 +- .../petstore_api/models/category.py | 2 +- .../petstore_api/models/type_holder_default.py | 2 +- .../petstore/python-tornado/docs/Animal.md | 2 +- .../petstore/python-tornado/docs/Category.md | 2 +- .../petstore/python-tornado/docs/FakeApi.md | 16 ++++++++-------- .../python-tornado/docs/TypeHolderDefault.md | 2 +- .../python-tornado/petstore_api/models/animal.py | 2 +- .../petstore_api/models/category.py | 2 +- .../petstore_api/models/type_holder_default.py | 2 +- samples/client/petstore/python/docs/Animal.md | 2 +- samples/client/petstore/python/docs/Category.md | 2 +- samples/client/petstore/python/docs/FakeApi.md | 16 ++++++++-------- .../petstore/python/docs/TypeHolderDefault.md | 2 +- .../python/petstore_api/models/animal.py | 2 +- .../python/petstore_api/models/category.py | 2 +- .../petstore_api/models/type_holder_default.py | 2 +- .../client/petstore/python/docs/Animal.md | 2 +- .../client/petstore/python/docs/Category.md | 2 +- .../client/petstore/python/docs/FakeApi.md | 16 ++++++++-------- .../openapi3/client/petstore/python/docs/Foo.md | 2 +- .../client/petstore/python/docs/InlineObject2.md | 2 +- .../python/petstore_api/models/animal.py | 2 +- .../python/petstore_api/models/category.py | 2 +- .../petstore/python/petstore_api/models/foo.py | 2 +- .../python/petstore_api/models/inline_object2.py | 2 +- 30 files changed, 58 insertions(+), 58 deletions(-) diff --git a/samples/client/petstore/python-asyncio/docs/Animal.md b/samples/client/petstore/python-asyncio/docs/Animal.md index d9a9be5bfe66..7ed4ba541fa3 100644 --- a/samples/client/petstore/python-asyncio/docs/Animal.md +++ b/samples/client/petstore/python-asyncio/docs/Animal.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | -**color** | **str** | | [optional] [default to "red"] +**color** | **str** | | [optional] [default to 'red'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-asyncio/docs/Category.md b/samples/client/petstore/python-asyncio/docs/Category.md index e6f8efaf2f54..7e5c1e316499 100644 --- a/samples/client/petstore/python-asyncio/docs/Category.md +++ b/samples/client/petstore/python-asyncio/docs/Category.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] -**name** | **str** | | [default to "default-name"] +**name** | **str** | | [default to 'default-name'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-asyncio/docs/FakeApi.md b/samples/client/petstore/python-asyncio/docs/FakeApi.md index 07d13239ed98..68a36b5f7525 100644 --- a/samples/client/petstore/python-asyncio/docs/FakeApi.md +++ b/samples/client/petstore/python-asyncio/docs/FakeApi.md @@ -633,13 +633,13 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) (default to "-efg") +enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) (default to "-efg") +enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') enum_query_integer = 56 # int | Query parameter enum test (double) (optional) enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = "$" # list[str] | Form parameter enum test (string array) (optional) (default to "$") -enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) (default to "-efg") +enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') +enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') try: # To test enum parameters @@ -653,13 +653,13 @@ enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) ( Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to "-efg"] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to "-efg"] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to "$"] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to "-efg"] + **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] ### Return type diff --git a/samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md b/samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md index 7a8b80eb8f8a..861da021826a 100644 --- a/samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md +++ b/samples/client/petstore/python-asyncio/docs/TypeHolderDefault.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**string_item** | **str** | | [default to "what"] +**string_item** | **str** | | [default to 'what'] **number_item** | **float** | | **integer_item** | **int** | | **bool_item** | **bool** | | [default to True] diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/animal.py b/samples/client/petstore/python-asyncio/petstore_api/models/animal.py index 859c7b2e5e3f..b338e0eb18e9 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/animal.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/animal.py @@ -48,7 +48,7 @@ class Animal(object): 'BigCat': 'BigCat' } - def __init__(self, class_name=None, color="red", local_vars_configuration=None): # noqa: E501 + def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 """Animal - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/category.py b/samples/client/petstore/python-asyncio/petstore_api/models/category.py index 95e1b8312d3f..b47c148953ea 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/category.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/category.py @@ -42,7 +42,7 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name="default-name", local_vars_configuration=None): # noqa: E501 + def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 """Category - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py index dc94e639eac2..8163ea77aa73 100644 --- a/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py +++ b/samples/client/petstore/python-asyncio/petstore_api/models/type_holder_default.py @@ -48,7 +48,7 @@ class TypeHolderDefault(object): 'array_item': 'array_item' } - def __init__(self, string_item="what", number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python-tornado/docs/Animal.md b/samples/client/petstore/python-tornado/docs/Animal.md index d9a9be5bfe66..7ed4ba541fa3 100644 --- a/samples/client/petstore/python-tornado/docs/Animal.md +++ b/samples/client/petstore/python-tornado/docs/Animal.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | -**color** | **str** | | [optional] [default to "red"] +**color** | **str** | | [optional] [default to 'red'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-tornado/docs/Category.md b/samples/client/petstore/python-tornado/docs/Category.md index e6f8efaf2f54..7e5c1e316499 100644 --- a/samples/client/petstore/python-tornado/docs/Category.md +++ b/samples/client/petstore/python-tornado/docs/Category.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] -**name** | **str** | | [default to "default-name"] +**name** | **str** | | [default to 'default-name'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python-tornado/docs/FakeApi.md b/samples/client/petstore/python-tornado/docs/FakeApi.md index 07d13239ed98..68a36b5f7525 100644 --- a/samples/client/petstore/python-tornado/docs/FakeApi.md +++ b/samples/client/petstore/python-tornado/docs/FakeApi.md @@ -633,13 +633,13 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) (default to "-efg") +enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) (default to "-efg") +enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') enum_query_integer = 56 # int | Query parameter enum test (double) (optional) enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = "$" # list[str] | Form parameter enum test (string array) (optional) (default to "$") -enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) (default to "-efg") +enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') +enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') try: # To test enum parameters @@ -653,13 +653,13 @@ enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) ( Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to "-efg"] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to "-efg"] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to "$"] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to "-efg"] + **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] ### Return type diff --git a/samples/client/petstore/python-tornado/docs/TypeHolderDefault.md b/samples/client/petstore/python-tornado/docs/TypeHolderDefault.md index 7a8b80eb8f8a..861da021826a 100644 --- a/samples/client/petstore/python-tornado/docs/TypeHolderDefault.md +++ b/samples/client/petstore/python-tornado/docs/TypeHolderDefault.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**string_item** | **str** | | [default to "what"] +**string_item** | **str** | | [default to 'what'] **number_item** | **float** | | **integer_item** | **int** | | **bool_item** | **bool** | | [default to True] diff --git a/samples/client/petstore/python-tornado/petstore_api/models/animal.py b/samples/client/petstore/python-tornado/petstore_api/models/animal.py index 859c7b2e5e3f..b338e0eb18e9 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/animal.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/animal.py @@ -48,7 +48,7 @@ class Animal(object): 'BigCat': 'BigCat' } - def __init__(self, class_name=None, color="red", local_vars_configuration=None): # noqa: E501 + def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 """Animal - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/category.py b/samples/client/petstore/python-tornado/petstore_api/models/category.py index 95e1b8312d3f..b47c148953ea 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/category.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/category.py @@ -42,7 +42,7 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name="default-name", local_vars_configuration=None): # noqa: E501 + def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 """Category - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py b/samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py index dc94e639eac2..8163ea77aa73 100644 --- a/samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py +++ b/samples/client/petstore/python-tornado/petstore_api/models/type_holder_default.py @@ -48,7 +48,7 @@ class TypeHolderDefault(object): 'array_item': 'array_item' } - def __init__(self, string_item="what", number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python/docs/Animal.md b/samples/client/petstore/python/docs/Animal.md index d9a9be5bfe66..7ed4ba541fa3 100644 --- a/samples/client/petstore/python/docs/Animal.md +++ b/samples/client/petstore/python/docs/Animal.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | -**color** | **str** | | [optional] [default to "red"] +**color** | **str** | | [optional] [default to 'red'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/Category.md b/samples/client/petstore/python/docs/Category.md index e6f8efaf2f54..7e5c1e316499 100644 --- a/samples/client/petstore/python/docs/Category.md +++ b/samples/client/petstore/python/docs/Category.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] -**name** | **str** | | [default to "default-name"] +**name** | **str** | | [default to 'default-name'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/client/petstore/python/docs/FakeApi.md b/samples/client/petstore/python/docs/FakeApi.md index 07d13239ed98..68a36b5f7525 100644 --- a/samples/client/petstore/python/docs/FakeApi.md +++ b/samples/client/petstore/python/docs/FakeApi.md @@ -633,13 +633,13 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) (default to "-efg") +enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) (default to "-efg") +enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') enum_query_integer = 56 # int | Query parameter enum test (double) (optional) enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = "$" # list[str] | Form parameter enum test (string array) (optional) (default to "$") -enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) (default to "-efg") +enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') +enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') try: # To test enum parameters @@ -653,13 +653,13 @@ enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) ( Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to "-efg"] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to "-efg"] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to "$"] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to "-efg"] + **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] ### Return type diff --git a/samples/client/petstore/python/docs/TypeHolderDefault.md b/samples/client/petstore/python/docs/TypeHolderDefault.md index 7a8b80eb8f8a..861da021826a 100644 --- a/samples/client/petstore/python/docs/TypeHolderDefault.md +++ b/samples/client/petstore/python/docs/TypeHolderDefault.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**string_item** | **str** | | [default to "what"] +**string_item** | **str** | | [default to 'what'] **number_item** | **float** | | **integer_item** | **int** | | **bool_item** | **bool** | | [default to True] diff --git a/samples/client/petstore/python/petstore_api/models/animal.py b/samples/client/petstore/python/petstore_api/models/animal.py index 859c7b2e5e3f..b338e0eb18e9 100644 --- a/samples/client/petstore/python/petstore_api/models/animal.py +++ b/samples/client/petstore/python/petstore_api/models/animal.py @@ -48,7 +48,7 @@ class Animal(object): 'BigCat': 'BigCat' } - def __init__(self, class_name=None, color="red", local_vars_configuration=None): # noqa: E501 + def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 """Animal - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python/petstore_api/models/category.py b/samples/client/petstore/python/petstore_api/models/category.py index 95e1b8312d3f..b47c148953ea 100644 --- a/samples/client/petstore/python/petstore_api/models/category.py +++ b/samples/client/petstore/python/petstore_api/models/category.py @@ -42,7 +42,7 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name="default-name", local_vars_configuration=None): # noqa: E501 + def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 """Category - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/client/petstore/python/petstore_api/models/type_holder_default.py b/samples/client/petstore/python/petstore_api/models/type_holder_default.py index dc94e639eac2..8163ea77aa73 100644 --- a/samples/client/petstore/python/petstore_api/models/type_holder_default.py +++ b/samples/client/petstore/python/petstore_api/models/type_holder_default.py @@ -48,7 +48,7 @@ class TypeHolderDefault(object): 'array_item': 'array_item' } - def __init__(self, string_item="what", number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 + def __init__(self, string_item='what', number_item=None, integer_item=None, bool_item=True, array_item=None, local_vars_configuration=None): # noqa: E501 """TypeHolderDefault - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/openapi3/client/petstore/python/docs/Animal.md b/samples/openapi3/client/petstore/python/docs/Animal.md index d9a9be5bfe66..7ed4ba541fa3 100644 --- a/samples/openapi3/client/petstore/python/docs/Animal.md +++ b/samples/openapi3/client/petstore/python/docs/Animal.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **class_name** | **str** | | -**color** | **str** | | [optional] [default to "red"] +**color** | **str** | | [optional] [default to 'red'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/Category.md b/samples/openapi3/client/petstore/python/docs/Category.md index e6f8efaf2f54..7e5c1e316499 100644 --- a/samples/openapi3/client/petstore/python/docs/Category.md +++ b/samples/openapi3/client/petstore/python/docs/Category.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **int** | | [optional] -**name** | **str** | | [default to "default-name"] +**name** | **str** | | [default to 'default-name'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/FakeApi.md b/samples/openapi3/client/petstore/python/docs/FakeApi.md index c57a587d893b..50de8cc758fa 100644 --- a/samples/openapi3/client/petstore/python/docs/FakeApi.md +++ b/samples/openapi3/client/petstore/python/docs/FakeApi.md @@ -756,13 +756,13 @@ with petstore_api.ApiClient() as api_client: # Create an instance of the API class api_instance = petstore_api.FakeApi(api_client) enum_header_string_array = ['enum_header_string_array_example'] # list[str] | Header parameter enum test (string array) (optional) -enum_header_string = "-efg" # str | Header parameter enum test (string) (optional) (default to "-efg") +enum_header_string = '-efg' # str | Header parameter enum test (string) (optional) (default to '-efg') enum_query_string_array = ['enum_query_string_array_example'] # list[str] | Query parameter enum test (string array) (optional) -enum_query_string = "-efg" # str | Query parameter enum test (string) (optional) (default to "-efg") +enum_query_string = '-efg' # str | Query parameter enum test (string) (optional) (default to '-efg') enum_query_integer = 56 # int | Query parameter enum test (double) (optional) enum_query_double = 3.4 # float | Query parameter enum test (double) (optional) -enum_form_string_array = "$" # list[str] | Form parameter enum test (string array) (optional) (default to "$") -enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) (default to "-efg") +enum_form_string_array = '$' # list[str] | Form parameter enum test (string array) (optional) (default to '$') +enum_form_string = '-efg' # str | Form parameter enum test (string) (optional) (default to '-efg') try: # To test enum parameters @@ -776,13 +776,13 @@ enum_form_string = "-efg" # str | Form parameter enum test (string) (optional) ( Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **enum_header_string_array** | [**list[str]**](str.md)| Header parameter enum test (string array) | [optional] - **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to "-efg"] + **enum_header_string** | **str**| Header parameter enum test (string) | [optional] [default to '-efg'] **enum_query_string_array** | [**list[str]**](str.md)| Query parameter enum test (string array) | [optional] - **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to "-efg"] + **enum_query_string** | **str**| Query parameter enum test (string) | [optional] [default to '-efg'] **enum_query_integer** | **int**| Query parameter enum test (double) | [optional] **enum_query_double** | **float**| Query parameter enum test (double) | [optional] - **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to "$"] - **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to "-efg"] + **enum_form_string_array** | [**list[str]**](str.md)| Form parameter enum test (string array) | [optional] [default to '$'] + **enum_form_string** | **str**| Form parameter enum test (string) | [optional] [default to '-efg'] ### Return type diff --git a/samples/openapi3/client/petstore/python/docs/Foo.md b/samples/openapi3/client/petstore/python/docs/Foo.md index e895b805e2e7..c55aa2cf103c 100644 --- a/samples/openapi3/client/petstore/python/docs/Foo.md +++ b/samples/openapi3/client/petstore/python/docs/Foo.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**bar** | **str** | | [optional] [default to "bar"] +**bar** | **str** | | [optional] [default to 'bar'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/docs/InlineObject2.md b/samples/openapi3/client/petstore/python/docs/InlineObject2.md index 342f90eaa759..9bfba12f6f15 100644 --- a/samples/openapi3/client/petstore/python/docs/InlineObject2.md +++ b/samples/openapi3/client/petstore/python/docs/InlineObject2.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **enum_form_string_array** | **list[str]** | Form parameter enum test (string array) | [optional] -**enum_form_string** | **str** | Form parameter enum test (string) | [optional] [default to Enum_form_stringEnum._EFG] +**enum_form_string** | **str** | Form parameter enum test (string) | [optional] [default to '-efg'] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py index be6372cac4e5..65cef1a60885 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/animal.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/animal.py @@ -47,7 +47,7 @@ class Animal(object): 'Cat': 'Cat' } - def __init__(self, class_name=None, color="red", local_vars_configuration=None): # noqa: E501 + def __init__(self, class_name=None, color='red', local_vars_configuration=None): # noqa: E501 """Animal - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/category.py b/samples/openapi3/client/petstore/python/petstore_api/models/category.py index 95e1b8312d3f..b47c148953ea 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/category.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/category.py @@ -42,7 +42,7 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name="default-name", local_vars_configuration=None): # noqa: E501 + def __init__(self, id=None, name='default-name', local_vars_configuration=None): # noqa: E501 """Category - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py index 74ebca1bb2ac..0a98b8837cac 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/foo.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/foo.py @@ -40,7 +40,7 @@ class Foo(object): 'bar': 'bar' } - def __init__(self, bar="bar", local_vars_configuration=None): # noqa: E501 + def __init__(self, bar='bar', local_vars_configuration=None): # noqa: E501 """Foo - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() diff --git a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py index 5b250b86ea11..f904d0a24d5d 100644 --- a/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py +++ b/samples/openapi3/client/petstore/python/petstore_api/models/inline_object2.py @@ -42,7 +42,7 @@ class InlineObject2(object): 'enum_form_string': 'enum_form_string' } - def __init__(self, enum_form_string_array=None, enum_form_string=Enum_form_stringEnum._EFG, local_vars_configuration=None): # noqa: E501 + def __init__(self, enum_form_string_array=None, enum_form_string='-efg', local_vars_configuration=None): # noqa: E501 """InlineObject2 - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration()