As per https://opencagedata.com/api#response the field results.annontations.timezone.offset_string is returned as a string. In the declaration for the JSON decoder it is listed as an Int.
@ConfiguredJsonCodec case class Timezone(
name: String,
nowInDst: Boolean,
offsetSec: Int,
offsetString: Int,
shortName: String
)
Which in turn causes this error:
Caused by: com.opencagedata.geocoder.DeserializationError: Failed to deserialize the response from the OpenCage server
at com.opencagedata.geocoder.OpenCageClient.handleHttpRequestSuccess(OpenCageClient.scala:120)
at com.opencagedata.geocoder.OpenCageClient.$anonfun$doCall$1(OpenCageClient.scala:77)
at scala.util.Success.$anonfun$map$1(Try.scala:251)
at scala.util.Success.map(Try.scala:209)
at scala.concurrent.Future.$anonfun$map$1(Future.scala:287)
at scala.concurrent.impl.Promise.liftedTree1$1(Promise.scala:29)
at scala.concurrent.impl.Promise.$anonfun$transform$1(Promise.scala:29)
at scala.concurrent.impl.CallbackRunnable.run_aroundBody0(Promise.scala:60)
at scala.concurrent.impl.CallbackRunnable$AjcClosure1.run(Promise.scala:1)
at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149)
Caused by: io.circe.DecodingFailure$$anon$2: Int: DownField(offset_string),DownField(timezone),DownField(annotations),DownArray,DownField(results)
As per https://opencagedata.com/api#response the field
results.annontations.timezone.offset_string
is returned as a string. In the declaration for the JSON decoder it is listed as an Int.Which in turn causes this error:
For the request to: https://api.opencagedata.com/geocode/v1/json?q=38.87789,-77.02259&key=xxxxxxxxxxxxxxxxxxxx
With a result of: