pub fn write_json<W: Write>( writer: &mut W, namespaces: &[NamespaceInfo], ) -> Result<(), Box<dyn Error>>
Writes namespaces as JSON to the given writer.
Returns an error if serialization or writing fails.