Base solution for your next web application
Open Closed

All input properties required after ABP upgrade #12353


User avatar
0
Astech created

We have just upgraded our solutions ABP nuget packages to version 10.

Since the upgrade we are getting errors all over the place for properties that are not provided to inputs but which are now being enforced as required. The EditUserInput for example has a property called FullName:

 public class EditUserInput : EntityDto
 {
     [StringLength(AbpUserBase.MaxNameLength)]
     public string Name { get; set; }

     public string FullName { get; set; } 
     
     ...     
}

Our application was quite happy not recieving a value for this before, but now we get the following error on user save:

Your request is not valid!
The following errors were detected during validation. - The FullName field is required.

The FullName property can probably be removed from that example, however we are getting this all over the place including for the ResetPassword page load:

Your request is not valid!
The following errors were detected during validation. - The Password field is required. - The ResetCode field is required. - The SingleSignIn field is required.

* The Password field is required.(password)
* The ResetCode field is required.(resetCode)
* The SingleSignIn field is required.(singleSignIn)
public class ResetPasswordInput: IShouldNormalize
{
    public long UserId { get; set; }

    public string ResetCode { get; set; }
    public DateTime ExpireDate { get; set; }

    [DisableAuditing]
    public string Password { get; set; }

    public string ReturnUrl { get; set; }

    public string SingleSignIn { get; set; }
 ...   
}

1 Answer(s)
  • User Avatar
    0
    Astech created

    Fixed with:

    services.AddControllersWithViews(options =>
    {
        options.SuppressImplicitRequiredAttributeForNonNullableReferenceTypes = true;