pub fn update_schema(a: &mut Value, b: &Value)
Expand description
Merge schema and update some keys
This is a thin wrapper around merge_schema
that additionally:
- Copies the value of the header key
requested-with-ajax
(all lower-case) into the variantsRequested-With-Ajax
(Pascal-Case) andREQUESTED-WITH-AJAX
(upper-case), or vice-versa, depending on which variant is present in the incoming schema. - Overwrites the top-level
version
field with the compile-time constantVERSION
.
The three header variants are created so that downstream code can read the header regardless of the casing rules enforced by the environment (HTTP servers, proxies, etc.).
§Arguments
a
– the targetValue
(must be anObject
) that will receive the merge result.b
– the sourceValue
(must be anObject
) whose contents are merged intoa
.