-
Notifications
You must be signed in to change notification settings - Fork 1
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
Order of relationships written to JSON file may be different from the order in which they were read #20
Comments
When using JSON.jl, to get back the objects in order you can pass in a dicttype arg:
|
(As I understand it, the reason is that the JSON spec says that objects are un-ordered collections, even though various implementations do provide functionality to read/write in ordered ways) |
I use the orderedDict in SPDX.jl and it works well. I think the bug is in how I'm creating the relationship vector in my own code. Need to review more and document a good example case. I care about the order because it allows for a user to read in a file, make some small modifications such as update the version and checksum, and then write it all back to file and only those changed elements show up in a git diff. If I don't use OrderedDict there's no guarantee that would happen. |
I tried recreating the issue and I can't do it. It doesn't matter anymore since I've updated the internal compare functions so they can handle out of order vectors. Close it for now, reopen if I find the bug again and I think it's important. |
Read a JSON file, then write it back out to another JSON file, then read that second file. The order of entries the Relationships vector is different. It doesn't matter at all from a data model point of view, but why does it do that?
The text was updated successfully, but these errors were encountered: