lapps/org.lappsgrid.metadata

Create ServiceMetadata from JSON

jcklie opened this issue · 3 comments

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?

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.

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

Fixed in 1.4.0 and in now on Maven Central.