-
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
feat: register additional JSON-LD files via config #3317
feat: register additional JSON-LD files via config #3317
Conversation
extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/JsonLdExtension.java
Outdated
Show resolved
Hide resolved
39264b4
to
0103710
Compare
0103710
to
fbd9143
Compare
extensions/common/json-ld/src/main/java/org/eclipse/edc/jsonld/JsonLdExtension.java
Fixed
Show fixed
Hide fixed
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 #3317 +/- ##
==========================================
+ Coverage 71.91% 71.93% +0.01%
==========================================
Files 810 810
Lines 16509 16524 +15
Branches 962 965 +3
==========================================
+ Hits 11872 11886 +14
Misses 4236 4236
- Partials 401 402 +1
☔ View full report in Codecov by Sentry. |
* converts a map entry, that looks like "something.url" -> https://foo.bar, into a map entry, that looks like | ||
* "something" -> ("url" -> "https://foo.bar") and adds it to an existing map | ||
*/ | ||
private void split(Map<String, Map<String, String>> targetMap, Map.Entry<String, String> entry) { |
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.
now this can be deleted
return service; | ||
} | ||
|
||
private void registerCachedDocumentsFromConfig(ServiceExtensionContext context, TitaniumJsonLd service) { | ||
Map<String, Map<String, String>> tempMappings = new HashMap<>(); |
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.
ditto
What this PR changes/adds
Adds the possibility to register additional files with the
CachedDocumentLoader
via config entries, e.g.:edc.jsonld.document.foo.path=/tmp/path/to/doc.json
edc.jsonld.document.foo.url=https://foo.com/doc.jsonld
Why it does that
configurability and flexibility in downstream projects
Further notes
aConfig#getRelativeEntries(String, boolean)
method was added to allow stripping away thebasePath
from resulting entries, returningfoo.path
instead ofedc.jsonld.document.foo.path
Linked Issue(s)
Closes #2951
Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.