There are two issues with PostSubmodelElementByPath when adding elements to a SubmodelElementList
- Semantics of PostSubmodelElementByPath undefined for adding elements to SubmodelElementList
When adding an element to a SubmodelElementList via PostSubmodelElementByPath it is undefined where in the list the new element is added. I assume it should be added to the end, however, this is not explicitely stated and therefore any implementation, like adding it at a random position, would be considered compliant to the specification.
- Asymmetry of API
The API allows to delete an element at a specific position within a SubmodelElementList but does not provide a way to add an element at a specific position within a SubmodelElementList. This is unexpected and such an operation would be very helpful for users.
- PostSubmodelElementByPath does not allow to add elements without idShort which is optional for elements within a SubmodelElementList
Specification (IDTA Number: 01002-3-0, June 2023, Section 5.3.11, p 35) states for operation PostSubmodelElementByPath
The idShort of the new submodel element must be set in the payload.
However, this prohibits adding a SubmodelElement without a idShort which is totally valid as long as the parent it is added to is of type SubmodelElementList.
Proposal(s):
- add optional parameter
index or position
- remove constraint that idShort must be set
There are two issues with PostSubmodelElementByPath when adding elements to a SubmodelElementList
When adding an element to a SubmodelElementList via PostSubmodelElementByPath it is undefined where in the list the new element is added. I assume it should be added to the end, however, this is not explicitely stated and therefore any implementation, like adding it at a random position, would be considered compliant to the specification.
The API allows to delete an element at a specific position within a SubmodelElementList but does not provide a way to add an element at a specific position within a SubmodelElementList. This is unexpected and such an operation would be very helpful for users.
Specification (IDTA Number: 01002-3-0, June 2023, Section 5.3.11, p 35) states for operation PostSubmodelElementByPath
The idShort of the new submodel element must be set in the payload.However, this prohibits adding a SubmodelElement without a idShort which is totally valid as long as the parent it is added to is of type SubmodelElementList.
Proposal(s):
indexorposition