Closed pederhan closed 1 month ago
The problem[tm] is that users have made it very clear that they want to be able to "null" this field. I suppose they can set it to
" "
, but I'm not sure that... better? :)
Sending an empty string (""
) works and is the only way to remove a comment through the API. Since the field on the model is not nullable, a PATCH request with the following JSON payload is the only way to unset a comment when sending JSON:
{"comment": ""}
Ah. Good. Well, eh, good enough? :) Happy for merge.
This PR fixes passing in an empty string as the comment argument to
host set_comment
:The error stemmed from the
Host.comment
field converting empty strings toNone
, which then subsequently caused revalidation to fail because our patch method expected to find an empty string in thecomment
field of the updated model (but gotNone
).This PR removes the nullability of the
comment
field, which matches the field on the server side.