def METHOD_NAME(fig1):
    dict1 = fig1.to_dict()
    # Set bad property name
    dict1["data"][0]["marker"]["bogus"] = 123
    # Set property with bad value
    dict1["data"][0]["marker"]["size"] = -1
    # Serialize to json
    bad_json = json.dumps(dict1, **opts)
    fig1_loaded = pio.from_json(bad_json, skip_invalid=True)
    # Check loaded figure
    assert pio.to_json(fig1_loaded) == pio.to_json(fig1.to_dict())