-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
Add ElementType.PARAMETER
to @JsonIgnore
to allow use for Constructor parameters
#258
Comments
One would expect Kotlin Data Class to handle annotations the same as Java Records, i.e. propagate annotation to fields and/or getters and/or constructor parameters depending on Looking at the decompiled Kotlin Data Class, something like this: data class BooleanPropertyInBody(@JsonIgnore val placeholder: String = "placeholder") { ... }
UPDATEAnnoying - from https://kotlinlang.org/docs/annotations.html#annotation-use-site-targets:
|
Ugh, I missed out an important fact in FasterXML/jackson-databind#4626:
Sorry! |
Uggh. As little as I like the idea, maybe I should revert this change. WDYT @yihtserns . But at least it was possible to pinpoint this change as the root cause for failing tests. |
I think it's fine to revert at the first sign of problem - I believe you have more important things to focus on than this (+ to reduce any unnecessary risk for the upcoming And it's not like this is something urgent or requested, we can always do it later if we really want to. |
PR reverted. |
… issues with Kotlin module (#260)
I myself was going to open a request for this feature cuz it is very useful specially when using lombok to have Or at least have an Ignore unkwon properties that really work.
then if i try
as far as i know there is no way to solve this without creating a custom deserializer or manually creating a constructor with @JsonCreator and both options are really inconvenient... would be appreciated have an way to solve it with aspects or at least in the configuration of ObjectMapper |
Unfortunately not sure we can proceed with this. |
(note: off-shoot of FasterXML/jackson-databind#4626)
Looks like
@JsonIgnore
cannot be used on method/constructor parameters: latter can be problematic with Record types in particular (but also regulard POJOs' Constructors or Factory methods).So let's add that in 2.18.
The text was updated successfully, but these errors were encountered: