def METHOD_NAME(value, context):
    if isinstance(value, string_types):
        try:
            return json.loads(value)
        except ValueError:
            raise df.Invalid(_('Could not parse as valid JSON'))
    else:
        return value