Skip to content

Commit 2471365

Browse files
committed
update spec
1 parent 63f5fc3 commit 2471365

9 files changed

Lines changed: 13 additions & 16 deletions

File tree

modules/openapi-generator/src/test/resources/3_0/python/petstore-with-fake-endpoints-models-for-testing.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2914,10 +2914,7 @@ components:
29142914
type: object
29152915
properties:
29162916
report_format:
2917-
type: string
2918-
allOf:
2919-
- $ref: '#/components/schemas/DataOutputFormat'
2920-
default: JSON
2917+
$ref: '#/components/schemas/DataOutputFormat'
29212918
DataOutputFormat:
29222919
type: string
29232920
enum: [JSON, CSV, XML]

samples/openapi3/client/petstore/python-aiohttp/docs/EnumRefWithDefaultValue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8-
**report_format** | [**DataOutputFormat**](DataOutputFormat.md) | | [optional] [default to 'JSON']
8+
**report_format** | [**DataOutputFormat**](DataOutputFormat.md) | | [optional] [default to DataOutputFormat.JSON]
99

1010
## Example
1111

samples/openapi3/client/petstore/python-aiohttp/petstore_api/models/enum_ref_with_default_value.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class EnumRefWithDefaultValue(BaseModel):
2727
"""
2828
EnumRefWithDefaultValue
2929
""" # noqa: E501
30-
report_format: Optional[DataOutputFormat] = 'JSON'
30+
report_format: Optional[DataOutputFormat] = DataOutputFormat.JSON
3131
__properties: ClassVar[List[str]] = ["report_format"]
3232

3333
model_config = ConfigDict(
@@ -81,7 +81,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8181
return cls.model_validate(obj)
8282

8383
_obj = cls.model_validate({
84-
"report_format": obj.get("report_format") if obj.get("report_format") is not None else 'JSON'
84+
"report_format": obj.get("report_format") if obj.get("report_format") is not None else DataOutputFormat.JSON
8585
})
8686
return _obj
8787

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/docs/EnumRefWithDefaultValue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**report_format** | [**DataOutputFormat**](DataOutputFormat.md) | | [optional] [default to 'JSON']
7+
**report_format** | [**DataOutputFormat**](DataOutputFormat.md) | | [optional]
88

99
## Example
1010

samples/openapi3/client/petstore/python-pydantic-v1-aiohttp/petstore_api/models/enum_ref_with_default_value.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class EnumRefWithDefaultValue(BaseModel):
2626
"""
2727
EnumRefWithDefaultValue
2828
"""
29-
report_format: Optional[DataOutputFormat] = 'JSON'
29+
report_format: Optional[DataOutputFormat] = None
3030
__properties = ["report_format"]
3131

3232
class Config:
@@ -65,7 +65,7 @@ def from_dict(cls, obj: dict) -> EnumRefWithDefaultValue:
6565
return EnumRefWithDefaultValue.parse_obj(obj)
6666

6767
_obj = EnumRefWithDefaultValue.parse_obj({
68-
"report_format": obj.get("report_format") if obj.get("report_format") is not None else 'JSON'
68+
"report_format": obj.get("report_format")
6969
})
7070
return _obj
7171

samples/openapi3/client/petstore/python-pydantic-v1/docs/EnumRefWithDefaultValue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Properties
55
Name | Type | Description | Notes
66
------------ | ------------- | ------------- | -------------
7-
**report_format** | [**DataOutputFormat**](DataOutputFormat.md) | | [optional] [default to 'JSON']
7+
**report_format** | [**DataOutputFormat**](DataOutputFormat.md) | | [optional]
88

99
## Example
1010

samples/openapi3/client/petstore/python-pydantic-v1/petstore_api/models/enum_ref_with_default_value.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class EnumRefWithDefaultValue(BaseModel):
2626
"""
2727
EnumRefWithDefaultValue
2828
"""
29-
report_format: Optional[DataOutputFormat] = 'JSON'
29+
report_format: Optional[DataOutputFormat] = None
3030
additional_properties: Dict[str, Any] = {}
3131
__properties = ["report_format"]
3232

@@ -72,7 +72,7 @@ def from_dict(cls, obj: dict) -> EnumRefWithDefaultValue:
7272
return EnumRefWithDefaultValue.parse_obj(obj)
7373

7474
_obj = EnumRefWithDefaultValue.parse_obj({
75-
"report_format": obj.get("report_format") if obj.get("report_format") is not None else 'JSON'
75+
"report_format": obj.get("report_format")
7676
})
7777
# store additional fields in additional_properties
7878
for _key in obj.keys():

samples/openapi3/client/petstore/python/docs/EnumRefWithDefaultValue.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
8-
**report_format** | [**DataOutputFormat**](DataOutputFormat.md) | | [optional] [default to 'JSON']
8+
**report_format** | [**DataOutputFormat**](DataOutputFormat.md) | | [optional] [default to DataOutputFormat.JSON]
99

1010
## Example
1111

samples/openapi3/client/petstore/python/petstore_api/models/enum_ref_with_default_value.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class EnumRefWithDefaultValue(BaseModel):
2727
"""
2828
EnumRefWithDefaultValue
2929
""" # noqa: E501
30-
report_format: Optional[DataOutputFormat] = 'JSON'
30+
report_format: Optional[DataOutputFormat] = DataOutputFormat.JSON
3131
additional_properties: Dict[str, Any] = {}
3232
__properties: ClassVar[List[str]] = ["report_format"]
3333

@@ -89,7 +89,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8989
return cls.model_validate(obj)
9090

9191
_obj = cls.model_validate({
92-
"report_format": obj.get("report_format") if obj.get("report_format") is not None else 'JSON'
92+
"report_format": obj.get("report_format") if obj.get("report_format") is not None else DataOutputFormat.JSON
9393
})
9494
# store additional fields in additional_properties
9595
for _key in obj.keys():

0 commit comments

Comments
 (0)