Skip to content
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

idShort for Elements within SML: does this have impact on API? #334

Closed
BirgitBoss opened this issue Oct 18, 2024 · 6 comments
Closed

idShort for Elements within SML: does this have impact on API? #334

BirgitBoss opened this issue Oct 18, 2024 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@BirgitBoss
Copy link
Collaborator

What is missing?

Describe the problem in short sentences, add a minimal example if possible
see
aas-spec #432

In V3.1 Metamodel is planned to support idShort also for SubmodelElementList. Does this have any impact on API?

@BirgitBoss BirgitBoss added the enhancement New feature or request label Oct 18, 2024
@BirgitBoss BirgitBoss added this to the 3.1 milestone Oct 18, 2024
@mjacoby
Copy link
Collaborator

mjacoby commented Oct 21, 2024

I think this would be a breaking change to the API because a server could now return MySubmodelElementCollection.MySubSubmodelElementList2[myFirstElement][anotherFirstElement] instead
MySubmodelElementCollection.MySubSubmodelElementList2[0][0] for the idShortPath serialization (see admin-shell-io/aas-specs#432 (comment)) which to older clients will not be a valid idShortPath.

@sebbader-sap
Copy link
Contributor

Remark: Most likely the final idShortPath would look like this: MySubmodelElementCollection.MySubSubmodelElementList2.myFirstElement.anotherFirstElement

@BirgitBoss
Copy link
Collaborator Author

BirgitBoss commented Oct 27, 2024

The API could define a parameter for path-with-list-number (default like today) and path-with-list-idshort: numbers re always available, idShort is optional. In case no idShort would be defined the index-number would be returned.

I.e. add new value to Content Parameters in [Clause SerializationModifier](https://admin-shell-io.github.io/aas-specs-antora/IDTA-01002/v3.1/specification/interfaces-operation-parameters.html#SerializationModifier*

@sebbader-sap
Copy link
Contributor

Maybe we don't need a new ContentParameter. A V3.1 server may treat the following IdShortPaths equivalently:
MySubmodelElementCollection.MySubSubmodelElementList2.myFirstElement.anotherFirstElement
MySubmodelElementCollection.MySubSubmodelElementList2[0].anotherFirstElement

While a V3.0 server may return a the SubmodelElement for the first variant but return a 404 for the latter. But syntactically / functionally all will work.

@mjacoby
Copy link
Collaborator

mjacoby commented Nov 12, 2024

If we treat both idShortPaths equivalently, what about the results returned by a server for requests with content=path in regards to backwards compatibility?

If a server is free to return any format, this would be a breaking change as v.30 clients could not handle paths like MySubmodelElementCollection.MySubSubmodelElementList2.myFirstElement.anotherFirstElement.

The only way I see to keep backwards compatibility would be to force v3.1 servers to always return index-based idShortPaths while accepting both index-based and idShort-based idShortPaths.

@mjacoby
Copy link
Collaborator

mjacoby commented Dec 13, 2024

Feedback from implementers via TF Interoperability of Implementations:

  • the motivating use case (Documentation of SML with SMC as child in Submodel Template (SMT) specifications submodel-templates#65) seem not really strong and should rather be solved by changing the table to not misuse idShort of type declaration but introduce a type field or similar
  • implementation would be possible but would require some efforts and maybe even pose a threat/challenge for scalability
  • also sentiment ist that accessing elements in a list/array by something else than the index is very unusual for an API/programming language

The conclusion is that the TF recommends to not go forward with this changes until there is a solid use case/requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants