support both rejectionPolicy and rejectionPolicyFactory in serde