-
Notifications
You must be signed in to change notification settings - Fork 10
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
Automatically casts numeric strings to integer even if spec says it's a string #62
Comments
Good catch! |
Well, I've prepared a small patch which removes the casting feature (which is "too smart"). |
Great! I think this resolves my problem. Thanks for the quick solution. When do you think this will be merged/released? |
I am expecting some extra feedback from @scaytrase If nothing pops up today, I think I'll tag |
#62 remove "smart" casting of parsed params to numerics
Tagged. Did it help? |
Yep. It solved my problem. Thank you 👍 |
This issue is closely related to #58 .
I have a path parameter that is a string. Though, if I pass a string that is numeric such as
"123"
you automatically cast it to an integer:https://github.com/lezhnev74/openapi-psr7-validator/blob/master/src/PSR7/OperationAddress.php#L98
This leads to the validation failing because the parameter is expected to be a string but it isn't because you cast it to an integer.
You should probably check if the specification says that the parameter is a string and if so don't cast it to an integer.
The text was updated successfully, but these errors were encountered: