watson-developer-cloud / java-sdk

:1st_place_medal: Java SDK to use the IBM Watson services.
http://watson-developer-cloud.github.io/java-sdk/
Apache License 2.0
590 stars 533 forks source link

[Discovery]CreateConfigurationResponse class issue loading fixture #528

Closed Mikemosca closed 7 years ago

Mikemosca commented 7 years ago

Using the response output in the Discovery API documentation to create the json files for the different classes for testing Discovery with mock output. So far so good until I came upon the create configuration class.

When trying to loadFixture for this class I get the following exception.

create_conf_resp = loadFixture(RESOURCE + "create_conf_resp.json", CreateConfigurationResponse.class);

com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line 1 column 892 path $.conversions.word.heading.styles
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:220)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.read(ReflectiveTypeAdapterFactory.java:116)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:216)
    at com.google.gson.Gson.fromJson(Gson.java:879)
    at com.google.gson.Gson.fromJson(Gson.java:844)
    at com.google.gson.Gson.fromJson(Gson.java:793)
    at com.google.gson.Gson.fromJson(Gson.java:765)
    at com.ibm.watson.developer_cloud.WatsonServiceTest.loadFixture(WatsonServiceTest.java:200)
    at com.ibm.watson.developer_cloud.discovery.v1.DiscoveryServiceTest.setup(DiscoveryServiceTest.java:155)  ...
Mikemosca commented 7 years ago

Talked with German and he adds...

The heading class has a FontStyles object which should be a list.

Mikemosca commented 7 years ago

In review

https://github.com/watson-developer-cloud/java-sdk/pull/606