Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chethan-89 opened this issue Nov 30, 2017 · 2 comments
Closed

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

chethan-89 opened this issue Nov 30, 2017 · 2 comments
Assignees
Labels

Comments

@chethan-89
Copy link

chethan-89 commented Nov 30, 2017

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();
@lpatino10
Copy link
Contributor

This issue is currently due to the EnrichmentOptions model being incorrectly described in the API spec. As soon as this is resolved, I'll make the change in the Java SDK.

@lpatino10 lpatino10 self-assigned this Dec 4, 2017
@rhorsfal
Copy link

rhorsfal commented Dec 7, 2017

I have a PR for that I expect it to be merged later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants