Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
[BUG] [Ruby] Initalize validation should apply to 'build_from_hash' too #5199
The changes to introduce better validation to the attributes hash in the
$ docker run --rm openapitools/openapi-generator-cli version
Steps to reproduce
Suggest a fix
Factor out the validation code from initialize and either call it directly from the 'build_from_hash' method, and/or add a 'strictValidation' parameter to allow backward compatibility.
Additionally the attribute names requirements are different between the methods
I think it is intentional that
That may be the case - also the round trip of
But there is also a use case where you want to validate the hash - say from user input. Which is the same process but with errors thrown.
Which perhaps suggests another method
I agree with @ackintosh's opinion. In particular, the following can be problematic.
I understand this use case. By the way,