8000 [Discovery] - Add/update configuration does not work · Issue #826 · watson-developer-cloud/java-sdk · GitHub
[go: up one dir, main page]

Skip to content

[Discovery] - Add/update configuration does not work #826

@chethan-89

Description

@chethan-89

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();

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0