-
Notifications
You must be signed in to change notification settings - Fork 527
Closed
Labels
Description
I am using the latest Java SDK. I tried adding configuration to Discovery using Java API. But it is failing. Although the config is pushed to Discovery, when you try to open the configuration at Discovery UI it does not since the configuration is parsed and uploaded in an incorrect format.
After debugging for a while, I noticed that, when parsing local config Json, it is skipping options part of enrichment. Please look at it and get the issue resolved. We have a client waiting for this feature.
Here is the code I used to add config:
Discovery discovery = new Discovery("Version");
discovery.setEndPoint("https://gateway.watsonplatform.net/discovery/api/");
discovery.setUsernameAndPassword("username:password");
String environmentId = "Env_ID";
String configurationName = "ConfigName";
CreateConfigurationOptions.Builder createBuilder = new CreateConfigurationOptions.Builder(environmentId);
Configuration configuration = GsonSingleton.getGson().fromJson(
new FileReader("config.json"), com.ibm.watson.developer_cloud.discovery.v1.model.Configuration.class);
createBuilder.configuration(configuration);
Configuration createResponse = discovery.createConfiguration(createBuilder.build()).execute();