def from_json_compatible(schema, dct):
    "Load from json-encodable"
    kwargs = {}

    for key in dct:
        field_type = schema._fields.get(key)
        if field_type is None:
            warnings.warn("Unexpected field encountered in line for record %s: %r" % (schema.__name__, key))
            continue
        kwargs[key] = field_type.avro_load(dct[key])

    return schema(**kwargs)