eclipse-tractusx / sldt-digital-twin-registry

Apache License 2.0
13 stars 26 forks source link

500 on non-UUID shell-descriptor/id #147

Closed arnoweiss closed 3 months ago

arnoweiss commented 1 year ago

The spec states that the id attribute in the AssetAdministrationShellDescriptor and SubmodelDescriptor are strings. Yet, in this Repo, they're both UUIDs.

Posting non-UUIDs against the DTR returns 500.

curl --location 'aas/shell-descriptors' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer token' \
--data '{
  "id": "https://sap.com/myidentifier/1234",
  "semanticId": {
    "type": "ExternalReference",
    "keys": [
      {
        "type": "GlobalReference",
        "value": "urn:bamm:io.catenax.material_for_recycling:1.1.0#MaterialForRecycling"
      }
    ]
  },
  "endpoints": [
    {
      "protocolInformation": {
        "href": "https://edc.data.plane/sometin/api/v3.0/submodel",
        "endpointProtocol": "HTTP",
        "endpointProtocolVersion": [
          "1.1"
        ],
        "subprotocol": "DSP",
        "subprotocolBody": "sometin",
        "subprotocolBodyEncoding": "plain",
        "securityAttributes": [
          {
            "type": "NONE",
            "key": "NONE",
            "value": "NONE"
          }
        ]
      },
      "interface": "SUBMODEL-3.0"
    }
  ]
}'
Pamela-Cofinity commented 7 months ago

@arnoweiss I was lookking to pick up this issue. Can you please tell me should the code implementation be changed to accept String instead of uuid or the spec needs to be corrected?

arnoweiss commented 7 months ago

This is an implementation bug (which I haven't reproduced since opening this issue a long time ago). The IDTA's spec of allowed values in the id field likely isn't gonna change anytime soon.

tunacicek commented 3 months ago

Bug is fixed. With the newest version it is possible to save shells (shell-descriptors) with non UUID.