Open Closed

After setting <Nullable>enable</Nullable> getting "The XXX field is required" for ALL fields #3784


User avatar
0
a3x created
  • ABP Framework version: v5.3.4
  • UI type: MVCr
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:

In a project I set the attribute <Nullable>enable</Nullable> within all my projects (csproj) in order to allow nullable types.

After starting the application I get for all tables and fields the error message "Field XXX is required" However, the fields are not marked as required in the view, nor in any DTO.

How can I solve this one?


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please try to set SuppressImplicitRequiredAttributeForNonNullableReferenceTypes of MvcOptions to true

    https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.mvcoptions.suppressimplicitrequiredattributefornonnullablereferencetypes?view=aspnetcore-6.0

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09