JsonSerializationMixin¶
- 
class lsst.verify.jsonmixin.JsonSerializationMixin¶
- Bases: - object- Mixin that provides JSON serialization support to subclasses. - Subclasses must implement the - jsonmethod. The method returns a- dictthat can be serialized to JSON. Use the- jsonify_dictmethod to handle the conversion of iterables, numbers, strings, booleans and- JsonSerializationMixin-compatible objects into a JSON-serialiable object.- Attributes Summary - json- dictthat can be serialized as semantic JSON, compatible with the SQUASH metric service.- Methods Summary - jsonify_dict(d)- Recursively build JSON-renderable objects on all values in a dict. - write_json(filepath)- Write JSON to a file. - Attributes Documentation - Methods Documentation - 
static jsonify_dict(d)¶
- Recursively build JSON-renderable objects on all values in a dict. - Parameters: - d : dict
- Dictionary to convert into a JSON-serializable object. Values are recursively JSON-ified. 
 - Returns: - json_dict : dict
- Dictionary that can be serialized to JSON. 
 - Examples - Subclasses can use this method to prepare output in their - json-method implementation. For example:- def json(self): return JsonSerializationMixin.jsonify_dict({ 'value': self.value, }) 
- d : 
 
- 
static