-
Notifications
You must be signed in to change notification settings - Fork 39
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
Improve Patch Generation logic and add tests #435
Conversation
scim-core/src/main/java/org/apache/directory/scim/core/repository/PatchGenerator.java
Outdated
Show resolved
Hide resolved
scim-core/src/main/java/org/apache/directory/scim/core/repository/PatchGenerator.java
Outdated
Show resolved
Hide resolved
081350c
to
87286fb
Compare
@@ -201,6 +202,7 @@ private static List<Schema.Attribute> createAttributes(String urn, List<Field> f | |||
log.debug("Attempting to set the attribute type, raw value = " + typeName); | |||
switch (typeName) { | |||
case STRING_TYPE_IDENTIFIER: | |||
case STRING_TYPE: |
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.
I need to add an issue to make coverage is good here.
These issues likely only affect Extensions, but that is still important.
The issue I was seeing is one of the Test object Extensions has a list of strings. Without this fix that list was, the list was showing up as a complex type, and would not diff correctly
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.
Before merging, i'll break this up into more isolated changes |
splitting this PR up, see: ##451 |
The json patch solution required seralizing objects, then processing them with zjsonpatch, and finally some heavy post processing. This new solution walks the tree schema attributes to calculate the diff directly. Class was moved to scim-tools, as it's not directly used by scim-server or scim-client. PatchGenerator could be used by a SCIM client to calculate diffs to send to a server Or to generate patch requests when testing a server. NOTE: There are some limitations, this implementation assumes any changes to an object in a collection modifies the whole object, this will alwasy trigger a REMOVE and ADD operation (instead of a REPLACE).
eeccacf
to
13f8718
Compare
Adding tests and thoughts for: #427
@joshuapsteele sorry, I thought I pushed this up the other day. this branch has problems, but hopefully it results in some thinking out loudAdd new diff implementation without the dependency on zjsonpatch