C
C#11mo ago
Obel

❔ When using AbstractValidator, is there any way that i can override the http status code?

Im trying to return a 422 HTTP Status code when the error occurs, but by default it returns a 400 Bad Request, is there any way to override this. I attached a snippet of the validator code
3 Replies
Pobiega
Pobiega11mo ago
No, because its not up to the validator The 400 bad request is returned by the http pipeline if a exception is thrown at a certain time, You can add your own middleware to return 422 here is a medium article that does it for a whole bunch of exceptions. figure out waht exception is thrown by Fluent and catch that yourself in a middleware like this
Accord
Accord11mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server
More Posts
❔ Best way to structure MVVM WPF App for multiples popupsHi ! I have a (nooby) WPF question. So I'm using MVVM paterns Here is my folder structure: ``` /MVVM❔ anyone uses/used/run splashkit on visual studio from iOS/MacBooks?Or any recommendation on tutorials ? Most tutorials I’ve seen were on windows and lowkey getting con❔ Whats the fastest way to write this data to a file? (C# Console App.)I need to write an int[][] to disk. Each int[] has 2 values, and the full int[][] has 100mil entries❔ Thin/Thick UI DesignHi! I've been a longtime c#.net programmer at a corporate office. I've been wanting to do some side Visual Studio project reference not updating with new codeBasically I have 2 projects in separate solutions, API and Data (the projects) API usually reference✅ HTTP Error 500.30 - ASP.NET Core app failed to startHello! I'm getting this error after deploying a net core app to IIS 10 (Windows 10 pc). Publish se✅ what is a .zero resource file?im looking at some code for an encoder/decoder and it uses a resource file called Aura.zero but its ❔ What is the best GUI system for C#?Does anyone know a good lib that impliment a gui system?Background service to consume a rabbitmq queue, messages unackedI have a background worker which listens to a rabbitmq queue for email sending. The messages are add❔ What is default data types when reading from Excel sheet for upload into DB.?I was trying to upload a excel sheet but having type miss match error while the data types in excel