You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I defined a custom problem ResourceNotFoundProblem and I was checking it in my unit test. However, the object mapper failed to deserialize it with the following exception:
com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'https://your-company.com/problems/ResourceNotFoundProblem.html as a subtype of `ResourceNotFoundProblem`: known type ids = [ResourceNotFoundProblem]
at [Source: (String)"{"id":"cd892175-ea84-4329-a3a0-aa7c40155bda","type":"https://your-company.com/problems/ResourceNotFoundProblem.html","title":"Resource not found","status":404,"detail":"Task cd892175-ea84-4329-a3a0-aa7c40155bda not found. Did you submit it recently? It may have expired from the result cache, or you might have submitted it to a different process."}"; line: 1, column: 53]
I don't know why, because I did not provide any JsonTypeInfo property. Here's my class definition:
Description
I defined a custom problem
ResourceNotFoundProblem
and I was checking it in my unit test. However, the object mapper failed to deserialize it with the following exception:I don't know why, because I did not provide any
JsonTypeInfo
property. Here's my class definition:And here's a sample to reproduce:
Here's my object mapper.
Expected Behavior
I expect the deserialization to work.
Actual Behavior
The deserialization does not work.
Possible Fix
Not sure what the root cause is. Is this expected to work?
Steps to Reproduce
Context
I can't test my code.
Your Environment
The text was updated successfully, but these errors were encountered: