From 9caa34c06649b4e20c3dfea46558de0348821eef 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 b3aaaa4c9b..875d639f5c 100644 --- a/src/plone/restapi/serializer/converters.py +++ b/src/plone/restapi/serializer/converters.py @@ -75,8 +75,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 (six.text_type, bool, int, float, int): return value