-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
BODY_DTO fails to correctly parse "false" for Boolean #901
Comments
When modifying the body parameter check mentioned above to the following:
I noticed I also needed to declare one of the operator!= definitions as const in the base DTOWrapper class: oatpp/src/oatpp/core/data/mapping/type/Object.hpp Lines 357 to 369 in 57e6a71
I suspect this is because the variable specified in the BODY_DTO macro has a const modifier: oatpp/src/oatpp/codegen/api_controller/base_define.hpp Lines 241 to 242 in 57e6a71
Couldn't think of a reason why making this method const would break anything and suspect it may need to be part of a fix for this issue. |
Observing some strange behavior when trying to parse a body dto for an endpoint which contains a single boolean value. Value is correctly parsed when equal to true, but fails when equal to false. Wondering if this is related to 673.
Issue is reproducible with a controller w/ the following structure:
When sending a request to this endpoint w/ a request body of "false", a 400 error is generated. When sending a request w/ a request body of "true", the boolean is correctly parsed.
I'm suspicious of the following section:
oatpp/src/oatpp/codegen/api_controller/base_define.hpp
Lines 243 to 245 in 57e6a71
Suspect that check should compare to nullptr similar to fix for 673.
The text was updated successfully, but these errors were encountered: