Skip to content

Commit 99d8371

Browse files
fbl100Frank Levine
andauthored
Fixes issue #8014, _check_type flag not being honored. (#8053)
* Fixes issue 8014, _check_type flag not being honored. Updated model_utils.mustache to pass the check_type flag into attempt_convert_item(). Failure to do so results in type validation errors occurring when the user has specifically requested that they be disabled. * regenerated samples Co-authored-by: Frank Levine <[email protected]>
1 parent e00ac50 commit 99d8371

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

modules/openapi-generator/src/main/resources/python/model_utils.mustache

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,7 +1116,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
11161116
configuration,
11171117
spec_property_naming,
11181118
key_type=False,
1119-
must_convert=True
1119+
must_convert=True,
1120+
check_type=_check_type
11201121
)
11211122
return converted_instance
11221123
else:
@@ -1136,7 +1137,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
11361137
configuration,
11371138
spec_property_naming,
11381139
key_type=False,
1139-
must_convert=False
1140+
must_convert=False,
1141+
check_type=_check_type
11401142
)
11411143
return converted_instance
11421144

samples/client/petstore/python/petstore_api/model_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
13981398
configuration,
13991399
spec_property_naming,
14001400
key_type=False,
1401-
must_convert=True
1401+
must_convert=True,
1402+
check_type=_check_type
14021403
)
14031404
return converted_instance
14041405
else:
@@ -1418,7 +1419,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
14181419
configuration,
14191420
spec_property_naming,
14201421
key_type=False,
1421-
must_convert=False
1422+
must_convert=False,
1423+
check_type=_check_type
14221424
)
14231425
return converted_instance
14241426

samples/openapi3/client/extensions/x-auth-id-alias/python/x_auth_id_alias/model_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
13981398
configuration,
13991399
spec_property_naming,
14001400
key_type=False,
1401-
must_convert=True
1401+
must_convert=True,
1402+
check_type=_check_type
14021403
)
14031404
return converted_instance
14041405
else:
@@ -1418,7 +1419,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
14181419
configuration,
14191420
spec_property_naming,
14201421
key_type=False,
1421-
must_convert=False
1422+
must_convert=False,
1423+
check_type=_check_type
14221424
)
14231425
return converted_instance
14241426

samples/openapi3/client/features/dynamic-servers/python/dynamic_servers/model_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
13981398
configuration,
13991399
spec_property_naming,
14001400
key_type=False,
1401-
must_convert=True
1401+
must_convert=True,
1402+
check_type=_check_type
14021403
)
14031404
return converted_instance
14041405
else:
@@ -1418,7 +1419,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
14181419
configuration,
14191420
spec_property_naming,
14201421
key_type=False,
1421-
must_convert=False
1422+
must_convert=False,
1423+
check_type=_check_type
14221424
)
14231425
return converted_instance
14241426

samples/openapi3/client/petstore/python/petstore_api/model_utils.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
13981398
configuration,
13991399
spec_property_naming,
14001400
key_type=False,
1401-
must_convert=True
1401+
must_convert=True,
1402+
check_type=_check_type
14021403
)
14031404
return converted_instance
14041405
else:
@@ -1418,7 +1419,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
14181419
configuration,
14191420
spec_property_naming,
14201421
key_type=False,
1421-
must_convert=False
1422+
must_convert=False,
1423+
check_type=_check_type
14221424
)
14231425
return converted_instance
14241426

0 commit comments

Comments
 (0)