Closed ilaif closed 4 years ago
I'm actually not 100% sure yet that this is an issue at all. As you can see in the definition of ModelItemIO
https://github.com/Midnighter/structurizr-python/blob/9396d6996d1b39ce875a8ccdf5d7f8ac45e337dc/src/structurizr/model/model_item.py#L32, tags are read as a string and split into a list. When serializing, the list is joined into a single string again. This is how the Structurizr API expects the tags. I don't see how this could change the order.
@ilaif am I mixing up the root of this issue?
I think that the cause of out-of-order tags is that in the python implementation the internal tags are inserted before the user's while in the other sdks its implemented in reverse order (internal after user)
Ah, you're right, we're using a List rather than a Set (Java uses a LinkedHashSet, presumably to preserve the ordering). That should make the fix even easier then. Should I take this one?
Please go ahead :smiley:
Is this as simple as using an OrderedSet as in https://code.activestate.com/recipes/576694/? If so is there a preference for reproducing this class versus adding a dependency to an existing implementation in PyPi?