fix(apiv2): get rid of large asp.net bad request errors

should also fix it for v1 :)
This commit is contained in:
spiral 2021-10-14 10:24:44 -04:00
parent e367ed6808
commit 8e1409bd17
No known key found for this signature in database
GPG Key ID: A6059F0CA0E1BD31

View File

@ -62,7 +62,11 @@ namespace PluralKit.API
{ {
// ... though by default it messes up timestamps in JSON // ... though by default it messes up timestamps in JSON
opts.SerializerSettings.DateParseHandling = DateParseHandling.None; opts.SerializerSettings.DateParseHandling = DateParseHandling.None;
}); })
.ConfigureApiBehaviorOptions(options =>
options.InvalidModelStateResponseFactory = (context) =>
throw Errors.GenericBadRequest
);
services.AddApiVersioning(); services.AddApiVersioning();