mod json#
- module json#
JSON utilities for the NeMo Flow runtime.
This module provides a
Jsontype alias forserde_json::Valueused throughout the crate, and amerge_jsonhelper for shallow-merging optional JSON values.Types
- type Json#
Type alias for
serde_json::Value, used as the universal JSON representation throughout the NeMo Flow runtime.
Functions
- fn merge_json(a: Option<Json>, b: Option<Json>) -> Option<Json>#
Shallow-merge two optional JSON values.
This is used throughout the runtime to combine optional
dataandmetadatapayloads without recursively descending into nested objects.Parameters
a: Base JSON value.b: Override JSON value.
Returns
An
Optioncontaining the merged JSON value. When both inputs are JSON objects, keys fromboverride keys froma. When only one input is present, that input is returned. When both inputs are present but at least one is not an object,bwins.Notes
The merge is shallow. Nested objects are replaced rather than merged recursively.