launchdarkly / api-client-java

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

The required field `contextTargets` is not found in the JSON string #14

Closed javydreamercsw closed 1 year ago

javydreamercsw commented 1 year ago

Upgrading from 13.0.0 to 14.0.0 [ERROR] The required fieldcontextTargetsis not found in the JSON string: {"rules":0,"nullRules":0,"targets":1}

Here's the relevant dump file content:

java.lang.IllegalArgumentException: The required field `contextTargets` is not found in the JSON string: {"rules":0,"nullRules":0,"targets":1}
    at com.launchdarkly.api.model.VariationSummary.validateJsonObject(VariationSummary.java:402)
    at com.launchdarkly.api.model.VariationSummary$CustomTypeAdapterFactory$1.read(VariationSummary.java:448)
    at com.launchdarkly.api.model.VariationSummary$CustomTypeAdapterFactory$1.read(VariationSummary.java:421)
    at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:204)
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
    at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:186)
    at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:144)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:393)
    at com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:299)
    at com.launchdarkly.api.model.FlagSummary$CustomTypeAdapterFactory$1.read(FlagSummary.java:274)
    at com.launchdarkly.api.model.FlagSummary$CustomTypeAdapterFactory$1.read(FlagSummary.java:245)
    at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:204)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:393)
    at com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:299)
    at com.launchdarkly.api.model.FeatureFlagConfig$CustomTypeAdapterFactory$1.read(FeatureFlagConfig.java:967)
    at com.launchdarkly.api.model.FeatureFlagConfig$CustomTypeAdapterFactory$1.read(FeatureFlagConfig.java:938)
    at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:204)
    at com.google.gson.internal.bind.TypeAdapterRuntimeTypeWrapper.read(TypeAdapterRuntimeTypeWrapper.java:40)
    at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:186)
    at com.google.gson.internal.bind.MapTypeAdapterFactory$Adapter.read(MapTypeAdapterFactory.java:144)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.readIntoField(ReflectiveTypeAdapterFactory.java:212)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$FieldReflectionAdapter.readField(ReflectiveTypeAdapterFactory.java:433)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:393)
    at com.google.gson.TypeAdapter.fromJsonTree(TypeAdapter.java:299)
    at com.launchdarkly.api.model.FeatureFlag$CustomTypeAdapterFactory$1.read(FeatureFlag.java:1129)
    at com.launchdarkly.api.model.FeatureFlag$CustomTypeAdapterFactory$1.read(FeatureFlag.java:1100)
    at com.google.gson.TypeAdapter$1.read(TypeAdapter.java:204)
    at com.google.gson.Gson.fromJson(Gson.java:1227)
    at com.google.gson.Gson.fromJson(Gson.java:1137)
    at com.google.gson.Gson.fromJson(Gson.java:1047)
    at com.google.gson.Gson.fromJson(Gson.java:1014)
    at com.launchdarkly.api.JSON.deserialize(JSON.java:531)
    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.FeatureFlagsApi.getFeatureFlagWithHttpInfo(FeatureFlagsApi.java:875)
    at com.launchdarkly.api.api.FeatureFlagsApi.getFeatureFlag(FeatureFlagsApi.java:849)
goyanespaula commented 1 year ago

We discovered a bug in our service API where contextTargets was omitted when empty, and this caused the latest client library version to fail because contextTargets was expected to be specified. We fixed the service issue and no new changes should be needed on your side.