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
Problem: REST API does not accept null for string values #135
Conversation
Codecov Report
@@ Coverage Diff @@
## master #135 +/- ##
==========================================
- Coverage 67.2% 67.17% -0.04%
==========================================
Files 64 64
Lines 3034 3034
==========================================
- Hits 2039 2038 -1
- Misses 995 996 +1
Continue to review full report at Codecov.
|
|
Are there any alternatives to this implementation? I'm concerned from the DRF docs that say "doing so means that there will be two differing types of empty value permissible for string representations, which can lead to data inconsistencies and subtle application bugs." |
|
The alternative is to not accept empty strings and only accept null. |
|
Adding WIP since we have a meeting to discuss tomorrow w/ @jlsherrill |
|
@bmbouter This is ready for re-review. |
cebd69e
to
c7d0b5f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like exactly what we talked about. Thanks @dkliban !
|
@dkliban actually it needs a breaking change 3.0 release note... |
Solution: update serializers to accept null This patch also removes the ability to specify an empty string for string fields. re: #4676 https://pulp.plan.io/issues/4676
| Breaking Changes | ||
| ---------------- | ||
|
|
||
| All the string fields in the REST API no longer accept an empty string as a value. These fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks great, thanks. +1 to merge
Solution: update serializers to accept null
re: #4676
https://pulp.plan.io/issues/4676