launchdarkly / api-client-java

LaunchDarkly API Client for Java
Other
4 stars 8 forks source link

ProjectsApi.getProjects fails with com.google.gson.JsonArray cannot be cast to class com.google.gson.JsonObject #12

Open memleak00 opened 1 year ago

memleak00 commented 1 year ago

Versions 10.0.0 to 12.0.0

ProjectsApi projectsApi = new ProjectsApi(...)
Projects result = projectsApi.getProjects(null, 0L, null, null);

Caused by: java.lang.ClassCastException: class com.google.gson.JsonArray cannot be cast to class com.google.gson.JsonObject (com.google.gson.JsonArray and com.google.gson.JsonObject are in unnamed module of loader 'app') at com.google.gson.JsonObject.getAsJsonObject(JsonObject.java:191) at com.launchdarkly.api.model.Project.validateJsonObject(Project.java:442) at com.launchdarkly.api.model.Projects.validateJsonObject(Projects.java:278) at com.launchdarkly.api.model.Projects$CustomTypeAdapterFactory$1.read(Projects.java:321) at com.launchdarkly.api.model.Projects$CustomTypeAdapterFactory$1.read(Projects.java:294) at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:199) at com.google.gson.Gson.fromJson(Gson.java:1058) at com.google.gson.Gson.fromJson(Gson.java:1016) at com.google.gson.Gson.fromJson(Gson.java:959) at com.launchdarkly.api.JSON.deserialize(JSON.java:423) at com.launchdarkly.api.ApiClient.deserialize(ApiClient.java:847) at com.launchdarkly.api.ApiClient.handleResponse(ApiClient.java:1055) at com.launchdarkly.api.ApiClient.execute(ApiClient.java:979) at com.launchdarkly.api.api.ProjectsApi.getProjectsWithHttpInfo(ProjectsApi.java:519) at com.launchdarkly.api.api.ProjectsApi.getProjects(ProjectsApi.java:493)

lucywyman commented 1 year ago

Oh ruuuuuude - thank you for raising this! Hopefully we can get to it next week and get a bug fix out!