aas-specs icon indicating copy to clipboard operation
aas-specs copied to clipboard

What is the Value-Only of a List of Operations or Capabilities

Open BirgitBoss opened this issue 10 months ago • 1 comments

Is your feature request related to a problem? Please describe. What is the Value-Only of a List of OPerations or Capabilities

Describe the solution you'd like If the submodel element list is part the Value-Only serialization of its parent element (e.g. in the context of a submodel or submodel element collection) and the list consists of submodel elements of type Operation or Capability, i.e. SubmodelElementList/typeValueListElement equal to Operation or Capability, the complete list is ignored.

In the case a collection contains

myCollection: 
{ 
   "prop1": string, 
   "capability1": Capability,
   "operation1": Operation,
    "list": SubmodelElementList(typeofElements:Operation) 
}

then Value-Only of the collection is either

{
 "prop1": "value of prop1"
}

Or

{
 "prop1": "value of prop1"
 "list": []
}

See also https://github.com/admin-shell-io/aas-specs-api/issues/270

The current schema looks like this (extract):

    "SubmodelElementListValue": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/SubmodelElementValue"
      }
    },

    "SubmodelElementValue": {
      "oneOf": [
        {
          "$ref": "#/definitions/BasicEventElementValue"
        },
        {
          "$ref": "#/definitions/RangeValue"
        },
        {
          "$ref": "#/definitions/MultiLanguagePropertyValue"
        },
        {
          "$ref": "#/definitions/FileBlobValue"
        },
        {
          "$ref": "#/definitions/ReferenceElementValue"
        },
        {
          "$ref": "#/definitions/RelationshipElementValue"
        },
        {
          "$ref": "#/definitions/AnnotatedRelationshipElementValue"
        },
        {
          "$ref": "#/definitions/EntityValue"
        },
        {
          "$ref": "#/definitions/PropertyValue"
        },
        {
          "$ref": "#/definitions/SubmodelElementListValue"
        }
      ]
    },

So recommendation is to stay with

{
 "prop1": "value of prop1"
 "list": []
}

BirgitBoss avatar Apr 11 '24 13:04 BirgitBoss