-
Notifications
You must be signed in to change notification settings - Fork 61
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
Identity attribute related swift #16
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If your JSON has the relationships by referencing the identity attribute instead of by nesting JSONs, you can take advantage of the
identityAttributeRelated
attribute. For example, if your JSONDictionary
is:you may not want Groot to serialize this dictionary by setting 1 to the
Publisher
relationship, but by assigning it with thePublisher
object which has 1 as itsidentityAttribute
value. You accomplish that by associating the identityAttribute key withtrue
(or any other positive boolean value) in the entity user info dictionary:This way, Groot will search in the publisher entity for a entry with the given identity attribute. If it is found, it will assign this entry as the
Publisher
object of theCharacter
; if it doesn't Groot will create a placeholderPublisher
entry with this value for the identity attribute. This placeholder object would be filled eventually if the new data is provided.Note: To make this feature works, you must always to use the merge methods instead of the insert ones.
Include test cases