Skip to content

Commit

Permalink
Fixes issue #8014, _check_type flag not being honored. (#8053)
Browse files Browse the repository at this point in the history
* 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 <frank.levine@blacklynx.tech>
  • Loading branch information
fbl100 and Frank Levine authored Dec 7, 2020
1 parent e00ac50 commit 99d8371
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=True
must_convert=True,
check_type=_check_type
)
return converted_instance
else:
Expand All @@ -1136,7 +1137,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=False
must_convert=False,
check_type=_check_type
)
return converted_instance

Expand Down
6 changes: 4 additions & 2 deletions samples/client/petstore/python/petstore_api/model_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=True
must_convert=True,
check_type=_check_type
)
return converted_instance
else:
Expand All @@ -1418,7 +1419,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=False
must_convert=False,
check_type=_check_type
)
return converted_instance

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=True
must_convert=True,
check_type=_check_type
)
return converted_instance
else:
Expand All @@ -1418,7 +1419,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=False
must_convert=False,
check_type=_check_type
)
return converted_instance

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=True
must_convert=True,
check_type=_check_type
)
return converted_instance
else:
Expand All @@ -1418,7 +1419,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=False
must_convert=False,
check_type=_check_type
)
return converted_instance

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=True
must_convert=True,
check_type=_check_type
)
return converted_instance
else:
Expand All @@ -1418,7 +1419,8 @@ def validate_and_convert_types(input_value, required_types_mixed, path_to_item,
configuration,
spec_property_naming,
key_type=False,
must_convert=False
must_convert=False,
check_type=_check_type
)
return converted_instance

Expand Down

0 comments on commit 99d8371

Please sign in to comment.