Skip to main content

interpolate_env_json

Function interpolate_env_json 

Source
pub fn interpolate_env_json(value: &mut Value)
Expand description

Recursively interpolates ${ENV_VAR:-default} patterns in every string leaf of a JSON value — object values, array elements, and nested combinations — leaving numbers, booleans, and null untouched.

This brings the same ${ENV_VAR} substitution that load_yaml_with_env applies to raw YAML text to config that arrives as already-parsed structured data — i.e. plugin node config authored through the Admin API / Web UI or delivered over etcd, which never passes through the file-text interpolation path. Applied at graph-compile time it is source-agnostic: a client_id: ${CLIENT_ID} set in the UI resolves exactly as it would in gateway.yaml. File-loaded values were already interpolated before parsing, so on them this is a no-op (the ${ fast-path guard skips them).