Closed arnoweiss closed 6 months ago
To my understanding, operations are not part of the valueOnly serialization. This is based on Section 11.4.2 (p.96)
Values are only available for • All subtypes of abstract type DataElement, • SubmodelElementList and SubmodelElementCollection resp. for their included SubmodelElements, • ReferenceElement, • RelationshipElement + AnnotatedRelationshipElement, • Entity, • BasicEventElement.
This also makes sense as operation arguments in the operation definitions typically do not have values but are only templates to be filled with values when the operation is actually invoked. So it is stated in the specification but there would be no harm in adding some sentences mentioning all elements that are not supported/included in valueOnly serialization and add an explanation why this is the case.
To me, the more interesting question would be if it is a valid use case that operation arguments in the operation definition can have values, e.g. representing a default value or some kind of static value that is not expected to be provided upon invocation. If this is a valid use case, wouldn't it make sense to at least serialize these properties?
Ah, didn't realize that this list is incomplete by design. Thanks for clarifying.
What happens?
Let's assume, a server handles a request
GET /submodels/{{mySubmodelId}}/$value
to a Submodel with two Properties and one Operation SubmodelElement. For Properties there's a schema entry (p.108) and examples (p.163). For value-only-serialization of the SubmodelElement Operation, there's no examples. The schema only containsOperationRequestValueOnly
andOperationResponseValueOnly
(p.107). These are primarily used for thePOST /submodels/{{mySubmodelId}}/{{pathToOperation}}/invoke/$value
request - not for representation as SubmodelElement as theoutputArguments
are missing from the request payload.Why is this wrong?
There's no clearly specified way to serialize Operations in the value-serialization. If it's invisible by design, that should be stated explicitly.
How should it be fixed?
Add statement like "The value-serialization for a Operation SubmodelElement is its
idShort
as key and a newOperationValueOnly
schema as value". Example:...