-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Keycloak admin client classic - use default Quarkus Jackson serializers also in native mode #29076
Keycloak admin client classic - use default Quarkus Jackson serializers also in native mode #29076
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @michalvavrik for your time
@michalvavrik when you say |
@gsmet Yes, what is the situation after the PR is that |
I agree the behavior should be the same. But I think we should make sure we have a specific ObjectMapper that is configured with the correct behavior required by the Keycloak Admin Client. But maybe I'm misunderstanding something. We can talk about it on Monday, there's no hurry. |
I don't say you are wrong, just for your information - user already could customize ObjectMapper before this PR in JVM mode - as in JVM mode, what I call Quarkus ObjectMapper was used (the one from Arc). Behavior only differed in the native mode where |
OK I had a closer look at this. I really think it's not a good idea to use the default Quarkus mapper as it might be configured by the user in a way that wouldn't be compatible with Keycloak. In any case, I think the discussion about the options to enable is a bit orthogonal, I would:
Let me know if I missed something but I think I have a better grasp at it now. |
I absolutely agree, that's why I suggested here #29035 (comment) that reactive shouldn't be used as fix. For example in #29035 user use KC 20.0.0 with
I could do that if no-one objects (next weekend, or maybe depending on result of the second point later?).
This change would be breaking one as till now user could customize KC I can imagine user want to be lenient to communication with an external interface that can change, but KC admin client failing over missing property is a good thing (valuable information, they still can work around it as I explained in #29035). |
closes: #29035
Currently behavior between
quarkus-keycloak-admin-client
andquarkus-keycloak-admin-client-reactive
differs in native mode where the classic version does fail on uknown properties during JSON deserialization. The reason is that in nativecom.fasterxml.jackson.jaxrs.json.JacksonJsonProvider
is missing (so producingReflectiveClassBuildItem
would fix the issue) and thus, QuarkusObjectMapper
is not loaded asQuarkusObjectMapperContextResolver
is never called (only in native). This PR prevents Keycloak from using it's own version ofResteasyJackson2Provider
(JacksonProvider
), therefore default Quarkus provider is used and QuarkusObjectMapper
is used. This is a native issue and we don't have suitable module so no automated tests.