fix(api/core/app/segments): Allow to contains boolean value in object segment (#7047)

This commit is contained in:
-LAN- 2024-08-07 16:20:22 +08:00 • committed by GitHub
commit aad02113c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 21 deletions

View file

@ -75,8 +75,7 @@ def build_segment(value: Any, /) -> Segment:
return FloatSegment(value=value)
if isinstance(value, dict):
# TODO: Limit the depth of the object
obj = {k: build_segment(v) for k, v in value.items()}
return ObjectSegment(value=obj)
return ObjectSegment(value=value)
if isinstance(value, list):
# TODO: Limit the depth of the array
elements = [build_segment(v) for v in value]