Bug Report
Describe the Bug
The Asset V4 API fails with HTTP 500 if trying to update an asset without supplying a valid data address.
Expected Behavior
No error raised. The Data address in the Asset should not be mandatory.
Observed Behavior
HTTP error 500. Server logs:
JerseyExtension: Unexpected exception caught
java.lang.NullPointerException: Cannot invoke "org.eclipse.edc.spi.types.domain.DataAddress.getType()" because "dataAddress" is null
at org.eclipse.edc.connector.core.validator.DataAddressValidatorRegistryImpl.validateSource(DataAddressValidatorRegistryImpl.java:49)
at org.eclipse.edc.connector.controlplane.services.asset.AssetServiceImpl.update(AssetServiceImpl.java:121)
at org.eclipse.edc.connector.controlplane.api.management.asset.BaseAssetApiController.updateAsset(BaseAssetApiController.java:121)
at org.eclipse.edc.connector.controlplane.api.management.asset.v4.AssetApiV4Controller.updateAssetV4(AssetApiV4Controller.java:80)
...
Steps to Reproduce
- Create an asset
curl -v --url "<management_url>/v4/assets" -X POST --json '{
"@context": ["https://w3id.org/edc/connector/management/v2"],
"@id": "test-asset",
"@type": "Asset",
"properties": {}
}'
- Try to update the asset and observe error response (HTTP 500):
curl -v --url "<management_url>/v4/assets" -X PUT --json '{
"@context": ["https://w3id.org/edc/connector/management/v2"],
"@id": "test-asset",
"@type": "Asset",
"properties": {}
}'
- Retry update, this time with a data address and observe successful response (HTTP 204):
curl -v --url "<management_url>/v4/assets" -X PUT --json '{
"@context": ["https://w3id.org/edc/connector/management/v2"],
"@id": "test-asset",
"@type": "Asset",
"properties": {},
"dataAddress": {"type": "DataAddress"}
}'
Context Information
EDC v0.17.0 / 737bfc9
Bug Report
Describe the Bug
The Asset V4 API fails with HTTP 500 if trying to update an asset without supplying a valid data address.
Expected Behavior
No error raised. The Data address in the Asset should not be mandatory.
Observed Behavior
HTTP error 500. Server logs:
Steps to Reproduce
Context Information
EDC v0.17.0 / 737bfc9