fix: make draft input bind idempotent

This commit is contained in:
lda
2026-06-29 19:35:53 +07:00 Verified
parent 89c405ed27
commit ca299e6fa0
+9 -6
View File
@@ -234,12 +234,15 @@ class WorkflowDraftAuthoringApi:
target_schema = workspace.draft.get(schema_key, {}) target_schema = workspace.draft.get(schema_key, {})
if not isinstance(target_schema, dict): if not isinstance(target_schema, dict):
raise ValueError(f"draft {schema_key} must be an object") raise ValueError(f"draft {schema_key} must be an object")
projected = project_property_to_schema_path( if _schema_path_exists(target_schema, source_parts):
target_schema=target_schema, projected = target_schema
source_schema=input_schema, else:
source_field=local_field, projected = project_property_to_schema_path(
target_parts=source_parts, target_schema=target_schema,
) source_schema=input_schema,
source_field=local_field,
target_parts=source_parts,
)
input_map = { input_map = {
**_input_map_from_payload(step.get("input", [])), **_input_map_from_payload(step.get("input", [])),
source_path: local_field, source_path: local_field,