Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/generators/python-aiohttp.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<ul class="column-ul">
<li>Dict</li>
<li>List</li>
<li>UUID</li>
<li>bool</li>
<li>bytes</li>
<li>date</li>
Expand Down
1 change: 1 addition & 0 deletions docs/generators/python-blueplanet.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<ul class="column-ul">
<li>Dict</li>
<li>List</li>
<li>UUID</li>
<li>bool</li>
<li>bytes</li>
<li>date</li>
Expand Down
1 change: 1 addition & 0 deletions docs/generators/python-fastapi.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<ul class="column-ul">
<li>Dict</li>
<li>List</li>
<li>UUID</li>
<li>bool</li>
<li>bytes</li>
<li>date</li>
Expand Down
1 change: 1 addition & 0 deletions docs/generators/python-flask.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<ul class="column-ul">
<li>Dict</li>
<li>List</li>
<li>UUID</li>
<li>bool</li>
<li>bytes</li>
<li>date</li>
Expand Down
1 change: 1 addition & 0 deletions docs/generators/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
<ul class="column-ul">
<li>Dict</li>
<li>List</li>
<li>UUID</li>
<li>bool</li>
<li>bytearray</li>
<li>bytes</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public AbstractPythonCodegen() {
// TODO file and binary is mapped as `file`
languageSpecificPrimitives.add("file");
languageSpecificPrimitives.add("bytes");
languageSpecificPrimitives.add("UUID");

typeMapping.clear();
typeMapping.put("integer", "int");
Expand All @@ -129,8 +130,7 @@ public AbstractPythonCodegen() {
// mapped to String as a workaround
typeMapping.put("binary", "str");
typeMapping.put("ByteArray", "str");
// map uuid to string for the time being
typeMapping.put("UUID", "str");
typeMapping.put("UUID", "UUID");
typeMapping.put("URI", "str");
typeMapping.put("null", "none_type");

Expand Down Expand Up @@ -571,7 +571,12 @@ public void setParameterExampleValue(CodegenParameter p) {
type = p.dataType;
}

if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) {
if (Boolean.TRUE.equals(p.isUuid)) {
if (example == null) {
example = "38400000-8cf0-11bd-b23e-10b96e4ef00d";
}
example = "UUID('" + escapeTextInSingleQuotes(example) + "')";
} else if ("String".equalsIgnoreCase(type) || "str".equalsIgnoreCase(type)) {
if (example == null) {
example = p.paramName + "_example";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ configuration = petstore_api.Configuration(
async with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
uuid_example = '84529ad2-2265-4e15-b76b-c17025d848f6' # str | uuid example
uuid_example = UUID('84529ad2-2265-4e15-b76b-c17025d848f6') # UUID | uuid example

try:
# test uuid example
Expand All @@ -1344,7 +1344,7 @@ async with petstore_api.ApiClient(configuration) as api_client:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**uuid_example** | **str**| uuid example |
**uuid_example** | **UUID**| uuid example |

### Return type

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Name | Type | Description | Notes
**binary** | **bytearray** | | [optional]
**var_date** | **date** | |
**date_time** | **datetime** | | [optional]
**uuid** | **str** | | [optional]
**uuid** | **UUID** | | [optional]
**password** | **str** | |
**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**pattern_with_digits_and_delimiter** | **str** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**uuid** | **UUID** | | [optional]
**date_time** | **datetime** | | [optional]
**map** | [**Dict[str, Animal]**](Animal.md) | | [optional]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Used to test oneOf enums with only one string value.

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | |
**id** | **UUID** | |
**activity** | [**TaskActivity**](TaskActivity.md) | |

## Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4932,7 +4932,7 @@ async def fake_uuid_example(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -4998,7 +4998,7 @@ async def fake_uuid_example_with_http_info(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -5064,7 +5064,7 @@ async def fake_uuid_example_without_preload_content(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down
4 changes: 2 additions & 2 deletions samples/openapi3/client/petstore/python-httpx/docs/FakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ configuration = petstore_api.Configuration(
async with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
uuid_example = '84529ad2-2265-4e15-b76b-c17025d848f6' # str | uuid example
uuid_example = UUID('84529ad2-2265-4e15-b76b-c17025d848f6') # UUID | uuid example

try:
# test uuid example
Expand All @@ -1344,7 +1344,7 @@ async with petstore_api.ApiClient(configuration) as api_client:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**uuid_example** | **str**| uuid example |
**uuid_example** | **UUID**| uuid example |

### Return type

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Name | Type | Description | Notes
**binary** | **bytearray** | | [optional]
**var_date** | **date** | |
**date_time** | **datetime** | | [optional]
**uuid** | **str** | | [optional]
**uuid** | **UUID** | | [optional]
**password** | **str** | |
**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**pattern_with_digits_and_delimiter** | **str** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**uuid** | **UUID** | | [optional]
**date_time** | **datetime** | | [optional]
**map** | [**Dict[str, Animal]**](Animal.md) | | [optional]

Expand Down
2 changes: 1 addition & 1 deletion samples/openapi3/client/petstore/python-httpx/docs/Task.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Used to test oneOf enums with only one string value.

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | |
**id** | **UUID** | |
**activity** | [**TaskActivity**](TaskActivity.md) | |

## Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4932,7 +4932,7 @@ async def fake_uuid_example(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -4998,7 +4998,7 @@ async def fake_uuid_example_with_http_info(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -5064,7 +5064,7 @@ async def fake_uuid_example_without_preload_content(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ configuration = petstore_api.Configuration(
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
uuid_example = '84529ad2-2265-4e15-b76b-c17025d848f6' # str | uuid example
uuid_example = UUID('84529ad2-2265-4e15-b76b-c17025d848f6') # UUID | uuid example

try:
# test uuid example
Expand All @@ -1344,7 +1344,7 @@ with petstore_api.ApiClient(configuration) as api_client:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**uuid_example** | **str**| uuid example |
**uuid_example** | **UUID**| uuid example |

### Return type

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Name | Type | Description | Notes
**binary** | **bytearray** | | [optional]
**var_date** | **date** | |
**date_time** | **datetime** | | [optional]
**uuid** | **str** | | [optional]
**uuid** | **UUID** | | [optional]
**password** | **str** | |
**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**pattern_with_digits_and_delimiter** | **str** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**uuid** | **UUID** | | [optional]
**date_time** | **datetime** | | [optional]
**map** | [**Dict[str, Animal]**](Animal.md) | | [optional]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Used to test oneOf enums with only one string value.

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | |
**id** | **UUID** | |
**activity** | [**TaskActivity**](TaskActivity.md) | |

## Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4932,7 +4932,7 @@ def fake_uuid_example(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -4998,7 +4998,7 @@ def fake_uuid_example_with_http_info(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -5064,7 +5064,7 @@ def fake_uuid_example_without_preload_content(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down
4 changes: 2 additions & 2 deletions samples/openapi3/client/petstore/python/docs/FakeApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1328,7 +1328,7 @@ configuration = petstore_api.Configuration(
with petstore_api.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = petstore_api.FakeApi(api_client)
uuid_example = '84529ad2-2265-4e15-b76b-c17025d848f6' # str | uuid example
uuid_example = UUID('84529ad2-2265-4e15-b76b-c17025d848f6') # UUID | uuid example

try:
# test uuid example
Expand All @@ -1344,7 +1344,7 @@ with petstore_api.ApiClient(configuration) as api_client:

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
**uuid_example** | **str**| uuid example |
**uuid_example** | **UUID**| uuid example |

### Return type

Expand Down
2 changes: 1 addition & 1 deletion samples/openapi3/client/petstore/python/docs/FormatTest.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Name | Type | Description | Notes
**binary** | **bytearray** | | [optional]
**var_date** | **date** | |
**date_time** | **datetime** | | [optional]
**uuid** | **str** | | [optional]
**uuid** | **UUID** | | [optional]
**password** | **str** | |
**pattern_with_digits** | **str** | A string that is a 10 digit number. Can have leading zeros. | [optional]
**pattern_with_digits_and_delimiter** | **str** | A string starting with &#39;image_&#39; (case insensitive) and one to three digits following i.e. Image_01. | [optional]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**uuid** | **str** | | [optional]
**uuid** | **UUID** | | [optional]
**date_time** | **datetime** | | [optional]
**map** | [**Dict[str, Animal]**](Animal.md) | | [optional]

Expand Down
2 changes: 1 addition & 1 deletion samples/openapi3/client/petstore/python/docs/Task.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Used to test oneOf enums with only one string value.

Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **str** | |
**id** | **UUID** | |
**activity** | [**TaskActivity**](TaskActivity.md) | |

## Example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4932,7 +4932,7 @@ def fake_uuid_example(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -4998,7 +4998,7 @@ def fake_uuid_example_with_http_info(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down Expand Up @@ -5064,7 +5064,7 @@ def fake_uuid_example_without_preload_content(


:param uuid_example: uuid example (required)
:type uuid_example: str
:type uuid_example: UUID
:param _request_timeout: timeout setting for this request. If one
number provided, it will be total request
timeout. It can also be a pair (tuple) of
Expand Down
Loading