Fild Validation Bug

I have a document and document status:

when status = new I get an error that the status is not filled, but for other statuses everything works
Is this a bug or am I doing something wrong?

Update:
does not work only for the first value

<ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.App" />
    <PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.4.4" />
    <PackageReference Include="MongoDB.Driver" Version="2.7.3" />
    <PackageReference Include="ServiceStack" Version="5.4.1" />
    <PackageReference Include="ServiceStack.Redis.Core" Version="5.4.1" />
  </ItemGroup>

Please paste code as text, not as images as every bug needs to be reproducible. Use code blocks for pasting code in markdown, e.g:

```csharp
// C# code here....
```

Refer to https://fluentvalidation.net docs for any info on FluentValdiation, e.g. you can’t validate a non-nullable Enum with NotNull() or NotEmpty() (which is meaningless for enums) as it will always have a value, if an Enum is never sent it will have the default (first) value. So if you want to ensure one is sent have the first value as None or Unspecified and have your validator check it’s not that. Alternatively you can use nullable Enum? and validate using NotNull().

1 Like