lapps / org.lappsgrid.metadata

Classes used to read and write LAPPS metadata.
Apache License 2.0
0 stars 0 forks source link

Create ServiceMetadata from JSON #16

Closed jcklie closed 5 years ago

jcklie commented 5 years ago

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 5 years ago

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:

  1. Use the ServiceMetadataBuilder class to generate the metadata, or
  2. Parse the JSON into a Map and then use the ServiceMetadata(Map) constructor.
ksuderman commented 5 years ago

I have restored the ServiceMetadata(String) constructor in commit 220e3747bd1c0df679a9879c54be2319d0aca384

The updated version is available from the Sonatype SNAPSHOT repository as version 1.4.0-SNAPSHOT

ksuderman commented 5 years ago

Fixed in 1.4.0 and in now on Maven Central.