Skip to main content

Module json

Module json 

Source
Available on crate feature serde only.
Expand description

JSON helpers shared by the forge wrappers, behind the serde feature — so the three forge parsers share one null -> "" and parse-error convention.

Functions§

from_json
Deserialize a forge CLI’s --json output into T, mapping a parse failure to Error::Parse tagged with program (the CLI’s binary name).
null_to_empty
Deserialize a String a forge CLI may send as JSON null for an empty optional value: null -> empty string, same as an absent key. #[serde(default)] alone covers only an absent key; a present null would fail the whole-object parse. Use as #[serde(deserialize_with = "vcs_cli_support::json::null_to_empty")].