-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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] [Ruby] Initalize validation should apply to 'build_from_hash' too #5199
Comments
Additionally the attribute names requirements are different between the methods
|
cc: Technical Committee (Ruby) 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, |
New doesn't appear to recurse like And as you say |
Description
The changes to introduce better validation to the attributes hash in the
initialize
method, should also apply in thebuild_from_hash
method.openapi-generator version
$ docker run --rm openapitools/openapi-generator-cli version
4.2.3-SNAPSHOT
Steps to reproduce
E.g.
vs
Related issues/PRs
#2226
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.
The text was updated successfully, but these errors were encountered: