Skip to content

[Python] Bug with required properties that are nullable #12021

@elias4335

Description

@elias4335
Description

When I use a method that returns properties that can be "nullable" the response classes setter method raises an error like this: "raise ValueError("Invalid value for vin, must not be None")". But since the property vin is set to nullable = true in the specification there should be no errror.

Swagger-codegen version

Version 3.0.36

Open API spec
--> https://gist.github.com/elias4335/94651f2efd49111b4344a5109da8b515

trouble code
 @vin.setter
    def vin(self, vin):
        """Sets the vin of this GetMachinesResponse.

        Machine Vehicle Identification Number  # noqa: E501

        :param vin: The vin of this GetMachinesResponse.  # noqa: E501
        :type: str
        """
        #if vin is None:
        #    raise ValueError("Invalid value for `vin`, must not be `None`")  # noqa: E501

        self._vin = vin

For now I just turned the code into comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions