Create ServiceMetadata from JSON
jcklie opened this issue · 3 comments
jcklie commented
I want to create ServiceMetadata
from DataSourceClient::getMetadata
. The documentation says
String json = "{ ... }";
ServiceMetadata metadata = new ServiceMetadata(json);
System.out.println(metadata.getVendor());
but I do not find this constructor in the actual code. What am I missing?
ksuderman commented
It looks like that constructor was removed from the class and the documentation was not updated. I will go though the Git log to determine when/why it was removed and either a) add it back, or b) update the documentation.
In the interim there are two options:
- Use the ServiceMetadataBuilder class to generate the metadata, or
- Parse the JSON into a Map and then use the ServiceMetadata(Map) constructor.
ksuderman commented
I have restored the ServiceMetadata(String)
constructor in commit 220e374
The updated version is available from the Sonatype SNAPSHOT repository as version 1.4.0-SNAPSHOT
ksuderman commented
Fixed in 1.4.0 and in now on Maven Central.