import json


def json_size_of_fields(d):
    """
    Get the json-size of the values of a dict.
    :param d: dict to diagnose
    :return: dict with the same first level fields as the input dict, but with:
        * an integer representing the length of the json.dumps string of the dict's field value
        * None if there was a problem json-izing the value
    """
    diag = dict()
    for k, v in d.items():
        try:
            diag[k] = len(json.dumps(v))
        except:
            diag[k] = None
    return diag