Skip to content

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

Description

@fbl100

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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions