decentralized-identity / jsonld-common-java

Shared JSON-LD Java library.
Apache License 2.0
7 stars 6 forks source link

feat: Make http and file document loaders more configurable. #6

Closed peacekeeper closed 2 years ago

peacekeeper commented 2 years ago

This makes it possible to instantiate ConfigurableDocumentLoader and JsonLDObject, without having to instantiate HttpLoader and FileLoader if they are not needed.

vitorpamplona commented 2 years ago

This works! Thanks!

vitorpamplona commented 2 years ago

Of course, I think it would be better if the lib drops the dependency entirely (Let people manually add custom DocumentLoaders for the web and local I/O). But this is a step in the right direction.

peacekeeper commented 2 years ago

I think it would be better if the lib drops the dependency entirely

I'm not sure what dependency to drop, since java.net.http.HttpClient is used directly by titanium-json-ld, which is central to this library.

Let people manually add custom DocumentLoaders

With this change, it should be possible to also add your own DocumentLoaders for http and file, bypassing the default ones altogether.

Do you have any suggestions how to improve this, or should I merge?

vitorpamplona commented 2 years ago

Please merge it. I was able to download the branch and test it. It runs beautifully.

On the dependency, I would argue that titanium-json-ld should stop using java.net.http.HttpClient as well. But that's for another day.

Thanks Markus