def _weakbound_for_json(value):
    """
    Simply call `for_json` on the underlying value if it exists; otherwise, return the underlying
    value.
    """
    return value.for_json() if hasattr(value, 'for_json') else value
