8000 implementing json patch by shawkins · Pull Request #40904 · keycloak/keycloak · GitHub
[go: up one dir, main page]

implementing json patch - #40904

Merged
vmuzikar merged 2 commits into
keycloak:feature/admin-api-v2from
shawkins:json-patch
Jul 15, 2025
Merged

vmuzikar merged 2 commits into
keycloak:feature/admin-api-v2from
shawkins:json-patch

Conversation

@shawkins
@shawkins shawkins commented Jul 3, 2025
Copy link
Copy Markdown
Contributor

@keycloak/cloud-native this is roughly what json patch support looks like. We would also need to put the fabric8 zjsonpatch dependency in the lib.

If we don't want the additional dependency, the alternative is to support jakarta.json / parsson (coming from Quarkus) - that seems slightly less efficient as we'll need to convert back and forth from the JsonValue representation.

Let me know what you think.

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
@vmuzikar vmuzikar left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good, straightforward enough. My only concern would be the zjsonpatch dependency. It seems more like an internal utility lib for Fabric8 rather than something truly standalone (e.g. there doesn't seem to be any docs etc.). I would be worried if we could truly rely on it (in terms of breaking changes, or if it simply doesn't disappear with the next Fabric8 release). Or it's not that case?

@shawkins
shawkins commented Jul 8, 2025
Copy link
Copy Markdown
Contributor Author

It seems more like an internal utility lib for Fabric8 rather than something truly standalone (e.g. there doesn't seem to be any docs etc.). I would be worried if we could truly rely on it (in terms of breaking changes, or if it simply doesn't disappear with the next Fabric8 release). Or it's not that case?

It's just a fork of the original zjsonpatch to strip it of additional dependencies and to always be aligned with our version of jackson fabric8io/kubernetes-client#6276

It has not been promoted for external usage, but it's highly unlikely to disappear.

The biggest downside to the usage of parsson is that it requires an additional serialization / deserialization from string. That is: object -> string (or char stream) -> apply patch -> string (or char stream) -> result object

The initial conversion from object to string will be handled by an ObjectMapper, which we can ultimately tweak if needed. However the JsonValue -> string conversion will be handled by a parsson JsonWriter which is not based upon Jackson and it's not clear how we would implement customizations - at the very least any Jackson annotations would not be used for this conversion step.

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
@shawkins
shawkins marked this pull request as ready for review July 9, 2025 16:44
@shawkins
shawkins requested review from a team as code owners July 9, 2025 16:44
@shawkins
shawkins commented Jul 9, 2025
Copy link
Copy Markdown
Contributor Author

@vmuzikar @mabartos should be working now - our prototype doesn't persist the data yet, but it does return the modified entity, so the tests are just checking for that.

@mabartos mabartos left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shawkins LGTM

@shawkins
shawkins requested a review from vmuzikar July 15, 2025 12:45
@shawkins
Copy link
Copy Markdown
Contributor Author

@vmuzikar are you good with merging?

@vmuzikar vmuzikar left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shawkins Sorry, sure, let's merge it.

@vmuzikar
vmuzikar merged commit 562be58 into keycloak:feature/admin-api-v2 Jul 15, 2025
mabartos pushed a commit that referenced this pull request Jul 22, 2025
* implementing json patch

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

* adding zjsonpatch to the dist and adding basic tests

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

---------

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
mabartos pushed a commit that referenced this pull request Aug 5, 2025
* implementing json patch

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

* adding zjsonpatch to the dist and adding basic tests

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

---------

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
mabartos pushed a commit that referenced this pull request Sep 5, 2025
* implementing json patch

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

* adding zjsonpatch to the dist and adding basic tests

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

---------

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
vmuzikar pushed a commit to vmuzikar/keycloak that referenced this pull request Oct 14, 2025
* implementing json patch

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

* adding zjsonpatch to the dist and adding basic tests

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

---------

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
vmuzikar pushed a commit to vmuzikar/keycloak that referenced this pull request Nov 3, 2025
* implementing json patch

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

* adding zjsonpatch to the dist and adding basic tests

Signed-off-by: Steve Hawkins <shawkins@redhat.com>

---------

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

0