-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
RecordIssue related to JDK17 java.lang.Record supportIssue related to JDK17 java.lang.Record support
Milestone
Description
A technique used to handle "unknown" properties of Records, wherein something like this is done:
interface NoOptionsCommand {
@JsonProperty("options")
default void setOptions(JsonNode value) {
if (value.isNull()) {
return;
}
throw new IllegalArgumentException("Non-null 'options' not allowed for "+getClass().getName());
}
}
public record FindOneCommand(int id, String filter)
implements NoOptionsCommand {
}
works with Jackson 2.14, but started failing with 2.15. It looks like "options" is sort of recognized as failure message lists it as known property, but setter is not used or called.
EDIT: actually, the real thing is that buffering is needed: above type is fine, but content MUST not include both id
and filter
properties.
yihtserns
Metadata
Metadata
Assignees
Labels
RecordIssue related to JDK17 java.lang.Record supportIssue related to JDK17 java.lang.Record support