Hi everyone, I’m working on a C# project and I’ve run into a huge inconsistency problem with my API responses. Here’s what’s happening:
I’m using FluentValidation for request validation. If validation fails, I throw a validation exception.
I have a global exception handler that catches exceptions and returns ProblemDetails.
For successful requests, I return my normal response DTO.
The problem is that my API responses are all over the place — the client sometimes gets ProblemDetails, sometimes a DTO, with no consistent structure. This is making the API confusing and hard to consume.
I’m lost on how to clean this mess.