mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-21 20:27:09 +00:00
Add UUID examples and documentation (#22303)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -108,6 +108,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
|
||||
// TODO file and binary is mapped as `file`
|
||||
languageSpecificPrimitives.add("file");
|
||||
languageSpecificPrimitives.add("bytes");
|
||||
languageSpecificPrimitives.add("UUID");
|
||||
|
||||
typeMapping.clear();
|
||||
typeMapping.put("integer", "int");
|
||||
@@ -129,8 +130,7 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
|
||||
// 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");
|
||||
|
||||
@@ -571,7 +571,12 @@ public abstract class AbstractPythonCodegen extends DefaultCodegen implements Co
|
||||
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";
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4932,7 +4932,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
@@ -4998,7 +4998,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
@@ -5064,7 +5064,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4932,7 +4932,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
@@ -4998,7 +4998,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
@@ -5064,7 +5064,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4932,7 +4932,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
@@ -4998,7 +4998,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
@@ -5064,7 +5064,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4932,7 +4932,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
@@ -4998,7 +4998,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
@@ -5064,7 +5064,7 @@ class FakeApi:
|
||||
|
||||
|
||||
: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
|
||||
|
||||
Reference in New Issue
Block a user