Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] [Python] validate_and_convert_types does not pass _check_type to attempt_convert_item #8014

Closed
fbl100 opened this issue Nov 24, 2020 · 0 comments · Fixed by #8053
Closed

Comments

@fbl100
Copy link
Contributor

fbl100 commented Nov 24, 2020

Bug Report Checklist

  • [ No] Have you provided a full/minimal spec to reproduce the issue?
  • [No ] Have you validated the input using an OpenAPI validator (example)?
  • [ Yes] Have you tested with the latest master to confirm the issue still exists?
  • [ Yes] Have you searched for related issues/PRs?
  • [ N/A] What's the actual output vs expected output?
  • [ No] [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description

The Python module's type validation fails on my model. It is unclear why this fails, but when using _check_input_type and _check_return_type to bypass the type validation, I find that there are times where it is still attempting to validate. I tracked this down to model_utils.mustache. It appears that the _check_type flag is not being passed into 'attempt_convert_item'. I do not know if this is by design, but passing this parameter along solved my issue. I will submit a PR with the update.

openapi-generator version

5.0.0-SNAPSHOT

OpenAPI declaration file content or url

I do not have a model definition that reproduces this. I cannot upload my model

Generation Details

N/A

Steps to reproduce

N/A

Related issues/PRs

N/A

Suggest a fix

add 'check_type=_check_type' to the 'attempt_convert_item' call on line 1122 (as of commit b5ce7ce)

@spacether spacether linked a pull request Dec 7, 2020 that will close this issue
5 tasks
spacether pushed a commit that referenced this issue Dec 7, 2020
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants