-
-
Notifications
You must be signed in to change notification settings - Fork 159
Closed
Labels
Description
This should be handled explictly and we should not assume any InvalidCastException
should return 409. Often times this is a 500 error.
JsonApiDotNetCore/src/JsonApiDotNetCore/Internal/JsonApiExceptionFactory.cs
Lines 14 to 20 in c2cb69f
// TODO: this is for mismatching type requests (e.g. posting an author to articles endpoint) | |
// however, we can't actually guarantee that this is the source of this exception | |
// we should probably use an action filter or when we improve the ContextGraph | |
// we might be able to skip most of deserialization entirely by checking the JToken | |
// directly | |
if (exceptionType == typeof(InvalidCastException)) | |
return new JsonApiException(409, exception.Message, exception); |