forked from loafle/openapi-generator-original
Update model_generic.mustache, tuple notation breaks when there is only one element in the tuple (#17749)
* Update model_generic.mustache, tuple notation breaks when there is only one element in the tuple
In this excerpt of the mustache template, the matching behaviour is bugged when there is only one element in the tuple notation. A single string with the tuple notation, e.g., `("string")`, will result in a string, and when values are compared with the string, it will do a `contains` match instead of an exact match, which is unintended behaviour.
* Update with samples, step 3
* Add test spec and regenerate samples
* Update samples
* Update spec and samples
* update samples
---------
Co-authored-by: Edmund Loo <edmundloo@users.noreply.github.com>
Co-authored-by: Edmund Loo <github.yn0u9@simplelogin.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# Bathing
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**task_name** | **str** | |
|
||||
**function_name** | **str** | |
|
||||
**content** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from petstore_api.models.bathing import Bathing
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Bathing from a JSON string
|
||||
bathing_instance = Bathing.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print Bathing.to_json()
|
||||
|
||||
# convert the object into a dict
|
||||
bathing_dict = bathing_instance.to_dict()
|
||||
# create an instance of Bathing from a dict
|
||||
bathing_form_dict = bathing.from_dict(bathing_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# Feeding
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**task_name** | **str** | |
|
||||
**function_name** | **str** | |
|
||||
**content** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from petstore_api.models.feeding import Feeding
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Feeding from a JSON string
|
||||
feeding_instance = Feeding.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print Feeding.to_json()
|
||||
|
||||
# convert the object into a dict
|
||||
feeding_dict = feeding_instance.to_dict()
|
||||
# create an instance of Feeding from a dict
|
||||
feeding_form_dict = feeding.from_dict(feeding_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# PoopCleaning
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**task_name** | **str** | |
|
||||
**function_name** | **str** | |
|
||||
**content** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from petstore_api.models.poop_cleaning import PoopCleaning
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of PoopCleaning from a JSON string
|
||||
poop_cleaning_instance = PoopCleaning.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print PoopCleaning.to_json()
|
||||
|
||||
# convert the object into a dict
|
||||
poop_cleaning_dict = poop_cleaning_instance.to_dict()
|
||||
# create an instance of PoopCleaning from a dict
|
||||
poop_cleaning_form_dict = poop_cleaning.from_dict(poop_cleaning_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
31
samples/openapi3/client/petstore/python-aiohttp/docs/Task.md
Normal file
31
samples/openapi3/client/petstore/python-aiohttp/docs/Task.md
Normal file
@@ -0,0 +1,31 @@
|
||||
# Task
|
||||
|
||||
Used to test oneOf enums with only one string value.
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **str** | |
|
||||
**activity** | [**TaskActivity**](TaskActivity.md) | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from petstore_api.models.task import Task
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of Task from a JSON string
|
||||
task_instance = Task.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print Task.to_json()
|
||||
|
||||
# convert the object into a dict
|
||||
task_dict = task_instance.to_dict()
|
||||
# create an instance of Task from a dict
|
||||
task_form_dict = task.from_dict(task_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# TaskActivity
|
||||
|
||||
|
||||
## Properties
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**task_name** | **str** | |
|
||||
**function_name** | **str** | |
|
||||
**content** | **str** | |
|
||||
|
||||
## Example
|
||||
|
||||
```python
|
||||
from petstore_api.models.task_activity import TaskActivity
|
||||
|
||||
# TODO update the JSON string below
|
||||
json = "{}"
|
||||
# create an instance of TaskActivity from a JSON string
|
||||
task_activity_instance = TaskActivity.from_json(json)
|
||||
# print the JSON string representation of the object
|
||||
print TaskActivity.to_json()
|
||||
|
||||
# convert the object into a dict
|
||||
task_activity_dict = task_activity_instance.to_dict()
|
||||
# create an instance of TaskActivity from a dict
|
||||
task_activity_form_dict = task_activity.from_dict(task_activity_dict)
|
||||
```
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user