AS am running an ASP.Net core web API from docker container , it throws a validation error :
System.InvalidOperationException: ValidationVisitor exceeded the maximum configured validation depth '32' when validating type 'ClassName'. This may indicate a very deep or infinitely recursive object graph. Consider modifying 'MvcOptions.MaxValidationDepth' or suppressing validation on the model type.
The only place I could find a discussion about this issue is in
here , where it seems that a fix has been provided on the latest version of ASP.net core . I updated my .net core version to the latest , but still facing the same issue.
Here is the code of the class where the validation is causing the issue :
[Required]
[Range(1, long.MaxValue)]
public long Id { get; set; }
[Required(AllowEmptyStrings = false)]
[StringLength(1000)]
public string Name { get; set; }
[Required(AllowEmptyStrings = false)]
[StringLength(200)]
public string Category { get; set; }
[Required(AllowEmptyStrings = false)]
[StringLength(13)]
public string Division { get; set; }
Important : Am the only one facing the issue , as the rest of my team is running the project successfully , any help is highly appreciated.