GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
When a parent record of a to-one or to-many relationship arrives before it's child, an empty child object is created. When the child record arrives, another new object is created with no way to relate it to it's parent. By adding the primary key value when creating missing child objets they can then be found and updated when the child record arrives.
When creating a missing mapped related entity, set the primary key.
Looks like Issue #223 was opened for this.
Hoping to get a unit test for this one. I just pushed a commit that should make writing tests easier (tests will now compile)
OK, cool! Got stuck doing planning all last week, but hopefully will have a chance to take another look this week. Took a quick look late that night we talked, and it may just be the way the JSON I'm getting is formatted. I'll let you know though. Thanks!
OK, so this ended up being an issue with the JSON. It was a to-one relationship, but in the JSON it only contained a single number for the ID of the child. From Saul's post on CIMGF I noticed that it seemed to only work that way if the value was an array of IDs, and it was a to-many relationship. The server-side is being developed in-house, so I was able to get them to "correct" the JSON.
Old (incorrect) JSON were "host" is the to-one relationship:
New (working) JSON:
I'd say this is pretty essential stuff!
Actually I need to reverse this commit. Totally forgot it was up on GitHub. The issue ended up being that my JSON was incorrectly formatted. This fixed it for my JSON format, but I have no idea what else it might have broken. I just changed my JSON format and the original code works fine. If you're seeing this issue check your JSON against the unit test examples in the project.