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

[Bug]: POST shell-descriptors returns HTTP 201 on duplicates instead of 409 #351

Open
arnoweiss opened this issue Sep 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@arnoweiss
Copy link

arnoweiss commented Sep 23, 2024

Contact Details

No response

Describe the bug

When adding a Shell-Descriptor to the AssetAdministrationShellRegistry API's shell-descriptors endpoint, that should raise a conflict. That's currently not the case, the shell-descriptor is overwritten.

To reproduce

  1. POST /shell-descriptors with payload
{
    "assetKind": "NotApplicable",
    "endpoints": [
        {
            "interface": "AAS-1.0",
            "protocolInformation": {
                        "href": "https://myorg.com/aas"
            }
        }
    ],
    "globalAssetId": "https://myorg.org/demo/something",
    "idShort": "unpatched",
    "id": "https://myorg.org/demo/something/aasid",
    "specificAssetIds": [
        {
            "name": "assetKind",
            "value": "Instance",
            "externalSubjectId": {
                "type": "ExternalReference",
                "keys": [
                    {
                        "type": "GlobalReference",
                        "value": "assetKind"
                    }
                ]
            }
        }
    ],
    "submodelDescriptors": [
        {
            "endpoints": [
                {
                    "interface": "SUBMODEL-1.0",
                    "protocolInformation": {
                        "href": "https://myorg.org/submodels/submodel3"
                    }
                }
            ],
            "idShort": "ProductCarbonFootprint",
            "id": "https://myorg.org/demo/somesubmodelid",
            "semanticId": {
                "type": "ExternalReference",
                "keys": [
                    {
                        "type": "GlobalReference",
                        "value": "https://zvei.org/demo/ProductCarbonFootprint/1/0"
                    }
                ]
            }
        },
        {
            "endpoints": [
                {
                    "interface": "SUBMODEL-1.0",
                    "protocolInformation": {
                        "href": "https://myorg.org/demo/submodel123"
                    }
                }
            ],
            "idShort": "BillOfMaterial",
            "id": "https://myorg.com/demo/submodelbom",
            "semanticId": {
                "type": "ExternalReference",
                "keys": [
                    {
                        "type": "GlobalReference",
                        "value": "http://example.com/id/type/submodel/BOM/1/1"
                    }
                ]
            }
        },
        {
            "endpoints": [
                {
                    "interface": "SUBMODEL-1.0",
                    "protocolInformation": {
                        "href": "https://myorg.com/demo/submodelbom/submodel"
                    }
                }
            ],
            "idShort": "Nameplate",
            "id": "https://myorg.com/demo/submodelnp",
            "semanticId": {
                "type": "ExternalReference",
                "keys": [
                    {
                        "type": "GlobalReference",
                        "value": "https://admin-shell.io/zvei/nameplate/1/0/Nameplate"
                    }
                ]
            }
        },
        {
            "endpoints": [
                {
                    "interface": "VC-1.0",
                    "protocolInformation": {
                        "href": "https://myorg.com/demo/submodelnp/submodel"
                    }
                }
            ],
            "idShort": "NameplateVC",
            "id": "https://myorg.com/demo/submodelnpvc",
            "semanticId": {
                "type": "ExternalReference",
                "keys": [
                    {
                        "type": "GlobalReference",
                        "value": "https://myorg.com/demo/submodelnpvc/submodel"
                    }
                ]
            }
        },
        {
            "endpoints": [
                {
                    "interface": "SUBMODEL-1.0",
                    "protocolInformation": {
                        "href": "https://myorg.com/demo/submodeltseries/submodel"
                    }
                }
            ],
            "idShort": "TechnicalData",
            "id": "https://myorg.com/demo/submodeltseries",
            "semanticId": {
                "type": "ExternalReference",
                "keys": [
                    {
                        "type": "GlobalReference",
                        "value": "http://admin-shell.io/ZVEI/TechnicalData/Submodel/1/1"
                    }
                ]
            }
        },
        {
            "endpoints": [
                {
                    "interface": "SUBMODEL-1.0",
                    "protocolInformation": {
                        "href": "https://myorg.com/submodel"
                    }
                }
            ],
            "idShort": "TimeSeries",
            "id": "https://zvei.org/demo/sm/0393_4150_3042_5412"
        }
    ]
}
  1. Execute the exact same request but replace the idShort with "idShort": "overwritten".

Screenshots

![DESCRIPTION](LINK.png)

Expected Behaviour

I'm expecting a conflict here but I simply get the permission to overwrite the data that's already there.
409 Conflict is the specified behavior in the normative openapi files [1].

[1] https://app.swaggerhub.com/apis/Plattform_i40/AssetAdministrationShellRegistryServiceSpecification/V3.0_SSP-001#/Asset%20Administration%20Shell%20Registry%20API/PostAssetAdministrationShellDescriptor

Version

No response

Operating System

No response

Relevant log output

No response

@arnoweiss arnoweiss added the bug Something isn't working label Sep 23, 2024
@arnoweiss arnoweiss changed the title [Bug]: POST shell-descriptors returns HTTP 201 on duplicates instead of 401 [Bug]: POST shell-descriptors returns HTTP 201 on duplicates instead of 409 Sep 23, 2024
@arnoweiss
Copy link
Author

The AAS repository API behaves correctly here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant