-
Notifications
You must be signed in to change notification settings - Fork 240
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
refactor: put DataAddress as Asset field #3244
refactor: put DataAddress as Asset field #3244
Conversation
* @return {@link StoreResult#success()} if the objects were stored, {@link StoreResult#alreadyExists(String)} when an object with the same ID already exists. | ||
*/ | ||
default StoreResult<Void> create(Asset asset) { | ||
return create(new AssetEntry(asset, asset.getDataAddress())); |
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #3244 +/- ##
==========================================
+ Coverage 65.93% 65.96% +0.02%
==========================================
Files 842 844 +2
Lines 16875 16954 +79
Branches 926 930 +4
==========================================
+ Hits 11126 11183 +57
- Misses 5380 5400 +20
- Partials 369 371 +2
☔ View full report in Codecov by Sentry. |
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.
Since we are not exposing raw Assets
(and thus: DataAddress
es) to the public, this change is good. It'll simplifies our management API.
However, since the DataAddress
itself is only a wrapper around a Map
(i.e. properties
) with named accessors, we could perhaps take things one step further and simplify even more by completely collapsing DataAddress
into Asset
. In another PR though.
What this PR changes/adds
Put
DataAddress
as a field ofAsset
Why it does that
At first they were kept separated because
DataAddress
was like "private data for asset", but now we have alsoprivateProperties
inAsset
, so there aren't good reasons to keep them split. Doing this we'll end up with a way more clean api.Further notes
/v3/assets
api endpoint that would avoid breaking changes, though the advice is to switch to the new api as soon as possible.Linked Issue(s)
Closes #3151
Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.