From 13b540d20ef3ffd1805de7f91f09d64bd7046d52 Mon Sep 17 00:00:00 2001 From: Johannes Raggam Date: Sun, 25 Aug 2024 01:35:14 +0200 Subject: [PATCH] Support for node.utils.Unset. --- src/plone/restapi/serializer/converters.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plone/restapi/serializer/converters.py b/src/plone/restapi/serializer/converters.py index 6da75b7540..ac286237ed 100644 --- a/src/plone/restapi/serializer/converters.py +++ b/src/plone/restapi/serializer/converters.py @@ -71,8 +71,9 @@ def json_compatible(value, context=None): @adapter(Interface) @implementer(IJsonCompatible) def default_converter(value): - if value is None: - return value + if value is None or repr(value) == "": + # None or node.utils.Unset + return None if type(value) in (str, bool, int, float, int): return value