-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pass DeserializationContext to JsonDeserializer.getObjectIdReader #1825
Comments
Correct, you probably do need But I am not 100% sure I follow from custom deserializer to need for access to object id reader? |
Maybe my conclusion wasn't good. I was using a mixin for @JsonDeserialize(as = PageRequest.class)
public class PageableMixIn {
} And another for public class PageRequestMixIn {
public PageRequestMixIn() {}
@JsonCreator
public PageRequestMixIn(
@JsonProperty("pageNumber") int page,
@JsonProperty("pageSize") int size,
@JsonProperty("sort") Sort sort) {}
} I have this mixin also for PageImpl: public class PageImplMixIn {
@JsonUnwrapped @JsonProperty private Pageable pageable;
} My issue is that when I replace the I thought that the issue would come from a missing ObjectIdReader in the deserializer. |
So ObjectIdReader had nothing to do with it. |
Ah ok. Yes, contextualization is... tricky. I wish I could simplify things, but there is a reason why this delegation model is used and I haven't been able to figure out simpler means to separate configuration by class configuration (from class annotations, by-type overrides) and by property overrides. But I am glad you were able to handle things without change for your current needs. |
I want to create a custom deserializer which have the sole purpose of providing a default value via
Pageable getNullValue(DeserializationContext ctxt)
.PageRequest
class implements interfacePageable
.The deserializer:
The deserializer must be able to keep working with
@JsonCreator
.Now correct me if I am wrong but I have no way to retrieve the default
ObjectIdReader
without having theDeserializationContext
ingetObjectIdReader
?The text was updated successfully, but these errors were encountered: