fix: error parsing object type parameters for code node (#22230)
This commit is contained in:
@@ -5,6 +5,8 @@ from base64 import b64encode
|
|||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
|
from core.variables.utils import SegmentJSONEncoder
|
||||||
|
|
||||||
|
|
||||||
class TemplateTransformer(ABC):
|
class TemplateTransformer(ABC):
|
||||||
_code_placeholder: str = "{{code}}"
|
_code_placeholder: str = "{{code}}"
|
||||||
@@ -95,7 +97,7 @@ class TemplateTransformer(ABC):
|
|||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def serialize_inputs(cls, inputs: Mapping[str, Any]) -> str:
|
def serialize_inputs(cls, inputs: Mapping[str, Any]) -> str:
|
||||||
inputs_json_str = json.dumps(inputs, ensure_ascii=False).encode()
|
inputs_json_str = json.dumps(inputs, ensure_ascii=False, cls=SegmentJSONEncoder).encode()
|
||||||
input_base64_encoded = b64encode(inputs_json_str).decode("utf-8")
|
input_base64_encoded = b64encode(inputs_json_str).decode("utf-8")
|
||||||
return input_base64_encoded
|
return input_base64_encoded
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user