-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Is your task related to a problem? Please describe.
"Apparently random order" of elements makes pull request reviews of such models very hard if the underlying model is very large, e.g. https://github.com/eclipse-tractusx/sldt-semantic-models/blob/main/io.catenax.battery.battery_pass/4.0.0/BatteryPass.ttl .
When loading such a model and adjusting multiple things in this model, e.g. add descriptions and see references to elements, the aspect model editor seems to manipulate:
- the order of the properties/characteristics etc in the ttl file
- the order of the attributes inside the property (e.g. description, see, preferredName).
This is not only a convenience, but also a risk for errors that are very hard to spot. During such PR reviews the shuffling of elements can lead to not realizing that properties were removed or renamed. In such cases, the generated OpenAPI spec and json schema
undergo fundamental changes which lead to breaking APIs, necessity of database migration etc.
Describe the solution you'd like
Inside a SAMM element there should be a canonical order of its attributes that is always kept.
These should follow the example of the SAMM documentation. (Apparently easy part)
The order of SAMM elements itself (e.g. the Properties) is a bit harder,
perhaps people want it in a logical order, others in an alphabetical order.
However, the order of those elements that are not added and not removed should not just be "arbitrarily shuffled around" making PR reviews so hard.
Perhaps the editor should provide options, like
- enforce alphabetic sorting
- keep order (append new elements to bottom)
- keep order (append new elements directly behind its parent element)
- ...
** Additional context **
Please provide a workaround until this issue is realized which outlines how PR reviewers can understand the actual changes of json schema