Description
Bug Report
Describe the Bug
This issue is a follow-up to the issue 4998
We are creating assets that sometimes belong to multiple groups. We use these groups in the asset selector of the contract definitions.
- Contract definition for asset group A: Asset selector -> assetGroups contains "A"
- Contract definition for asset group B: Asset selector -> assetGroups contains "B"
When we create an asset with "assetGroups":["A","B"] we are able to visualize the offers in the consumer connectors.
However when we create assets that are part of only one group: "assetGroups":["A"]
The assets are created as a literal string in the provider catalogue-> "assetGroups":"A"
This directly impacts the asset selector, as we are not able to generate offers for this asset because it no longer matches the asset selector.
The logic works perfectly for assets that are part of multiple groups, "assetGroups":["A","B"].
We are aware of issue 4525 ; however, we think this is a slightly different issue.
Expected Behavior
The property should be interpreted as an array when creating the asset.
Observed Behavior
A literal string is created in the provider catalog, and therefore, an offer is not generated for the asset in the consumer catalog.
Steps to Reproduce
Steps to reproduce the behavior:
- Create a contract definition using an asset selector:
"assetsSelector": [
{
"@type": "Criterion",
"operandLeft": "https://w3id.org/edc/v0.0.1/ns/assetGroups",
"operator": "contains",
"operandRight": "A"
}
]
- Create an asset with the property assetGroups = A
"properties": {
"assetGroups":["A"]
}
- Check the asset properties from your newly created asset:
"properties": {
"assetGroups":"A"
}
Context Information
Used version : EDC 0.13.0-SNAPSHOT
Possible Implementation
You already know the root cause of the erroneous state and how to fix it? Feel free to share your thoughts.