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

View File

@@ -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();