-
Notifications
You must be signed in to change notification settings - Fork 232
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
feat: add json-ld module #2653
feat: add json-ld module #2653
Conversation
} | ||
}; | ||
mapper.registerModule(module); | ||
mapper.registerSubtypes(AtomicConstraint.class, LiteralExpression.class); |
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.
this subtypes registration shouldn't happen in this module
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.
where should it happen then? I think the only other option would be for every extension using this mapper to register them itself.
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.
They can be registered in a module lower or higher, depending on where we want to deserialize them. For example, in the IDS transformer module for JSON-LD or in core module if we want them registered against the default context.
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.
This registration is the link between json-ld and the policy model classes, I think they will stay better where the json-ld to policy transformers are.
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 left two comments. After those are resolved, LGTM.
} | ||
}; | ||
mapper.registerModule(module); | ||
mapper.registerSubtypes(AtomicConstraint.class, LiteralExpression.class); |
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.
They can be registered in a module lower or higher, depending on where we want to deserialize them. For example, in the IDS transformer module for JSON-LD or in core module if we want them registered against the default context.
extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/JsonLdExtension.java
Show resolved
Hide resolved
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #2653 +/- ##
==========================================
- Coverage 64.52% 64.36% -0.16%
==========================================
Files 891 894 +3
Lines 18276 18344 +68
Branches 1087 1097 +10
==========================================
+ Hits 11792 11807 +15
- Misses 6050 6096 +46
- Partials 434 441 +7
... and 12 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
What this PR changes/adds
Adds an extension that provides an ObjectMapper for working with JSON-LD and utility functions for expanding and compacting JSON-LD structures.
Why it does that
JSON-LD support is required for the dataspace protocol implementation.
Further notes
Transformers that handle the mapping between EDC model and JSON-LD will be added in a separate PR.
Linked Issue(s)
Relates #2474
Checklist
no-changelog
)