-
Notifications
You must be signed in to change notification settings - Fork 0
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
Handle boolean values #1
Conversation
Do not set any value if boolean value is false
Codecov Report
@@ Coverage Diff @@
## master #1 +/- ##
=======================================
- Coverage 86.95% 84% -2.96%
=======================================
Files 2 2
Lines 23 25 +2
=======================================
+ Hits 20 21 +1
- Misses 3 4 +1
Continue to review full report at Codecov.
|
Hi! Thanks for your PR first. The different serializers makes boolean transformations differently. So, I don't think it is really necessary thing, because you can always write a converter on the server that will handle boolean values. Do you? |
From https://www.w3.org/TR/html401/interact/forms.html#checkbox
From https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/checkbox
I would argue that following standard HTML form submitting procedure would provide most suitable developer experience. Since |
I understood your point. Following standards wasn't a general purpose for me, when I have made this library. It's just a tiny object/collection serializer which is more like Anyway, I can make this case configurable by adding strict mode, if you need it. Are you argree with that? Also, please be consider to send pull requests from different branches, not from |
I've implemented your proposal as serialization option. See API section in documentation for more information. |
@octet-stream Thank you very much :) |
At the moment boolean values are transformed to string (ex:
false
becomes"false"
).This PR handles boolean values as special case and does not set any value if boolean value is false which is how HTML form handles checkboxes.