-
Notifications
You must be signed in to change notification settings - Fork 265
feat: make data address handle complex properties #5012
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
base: main
Are you sure you want to change the base?
feat: make data address handle complex properties #5012
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just very small things, looks good
...ava/org/eclipse/edc/transform/transformer/edc/to/JsonObjectToDataAddressTransformerTest.java
Outdated
Show resolved
Hide resolved
spi/common/core-spi/src/main/java/org/eclipse/edc/spi/types/domain/DataAddress.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also add an e2e track on this, like in the AssetApiEndToEndTest
, no need for an explicit test, just adding a complex property in the data address there and verifying that the output is consistent would be enough
...ava/org/eclipse/edc/transform/transformer/edc/from/JsonObjectFromDataAddressTransformer.java
Outdated
Show resolved
Hide resolved
...ava/org/eclipse/edc/transform/transformer/edc/to/JsonObjectToDataAddressTransformerTest.java
Show resolved
Hide resolved
...ava/org/eclipse/edc/transform/transformer/edc/to/JsonObjectToDataAddressTransformerTest.java
Outdated
Show resolved
Hide resolved
...dc/protocol/dsp/transferprocess/transform/from/JsonObjectFromDataAddressTransformerTest.java
Outdated
Show resolved
Hide resolved
...dc/protocol/dsp/transferprocess/transform/from/JsonObjectFromDataAddressTransformerTest.java
Outdated
Show resolved
Hide resolved
.../eclipse/edc/connector/api/management/configuration/ManagementApiConfigurationExtension.java
Outdated
Show resolved
Hide resolved
...main/java/org/eclipse/edc/connector/dataplane/selector/DataPlaneSelectorClientExtension.java
Outdated
Show resolved
Hide resolved
spi/common/core-spi/src/test/java/org/eclipse/edc/spi/types/domain/DataAddressTest.java
Outdated
Show resolved
Hide resolved
...in/java/org/eclipse/edc/transform/transformer/edc/to/JsonObjectToDataAddressTransformer.java
Outdated
Show resolved
Hide resolved
...in/java/org/eclipse/edc/transform/transformer/edc/to/JsonObjectToDataAddressTransformer.java
Outdated
Show resolved
Hide resolved
LinkedHashMap<String, Object> complex = new LinkedHashMap<>(); | ||
visitProperties(props, (k, v) -> complex.put(k, transformGenericProperty(v, context))); | ||
builder.property(key, complex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this logic will support a second level of nested properties.
Could this be handled like it has been done in the JsonObjectToAssetTransformer
? That one should already handle such case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not sure how to handle it like it's done in the JsonObjectToAssetTransformer
, so didn't do it that way.
I gave it a try nevertheless. Let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the other transformer it just uses transformGenericProperty
, that deserialize the whole json object into a map, that should be enough right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. What I was trying to achieve is a deserialization where the values wouldn't be wrapped into lists of value maps (as it happens with the deserialization using transformGenericProperty
). But since it is done on another places too, i'll leave it be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another thing that's overlooked in the JsonObjectToAssetTransformer
is that JsonLD keywords in nested maps will not be ignored as in the root map, since the transformGenericProperty
will eat everything as is. If this is not intended it should be fixed...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rafaelmag110 what do you mean with "ignored"?
the workaround to transform a single value array into a string is indeed a workaround, so is ok if it's applied only on top level.
This reverts commit 1358ad4.
...dc/protocol/dsp/transferprocess/transform/from/JsonObjectFromDataAddressTransformerTest.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
checkstyle has been updated, if you rebase the branch it should execute correctly
What this PR changes/adds
Changes
DataAddress
TO and FROM transformers to allow complex attributes such as json objects or json arrays to be used.Who will sponsor this feature?
@jimmarino
@ndr-brt
Linked Issue(s)
Closes #4986