diff --git a/PluralKit.API/Startup.cs b/PluralKit.API/Startup.cs index df292497..1a01356c 100644 --- a/PluralKit.API/Startup.cs +++ b/PluralKit.API/Startup.cs @@ -62,7 +62,11 @@ namespace PluralKit.API { // ... though by default it messes up timestamps in JSON opts.SerializerSettings.DateParseHandling = DateParseHandling.None; - }); + }) + .ConfigureApiBehaviorOptions(options => + options.InvalidModelStateResponseFactory = (context) => + throw Errors.GenericBadRequest + ); services.AddApiVersioning();