code: @Override
      public Date deserialize(JsonElement json, Type date, JsonDeserializationContext context) throws JsonParseException {
          String str = json.getAsJsonPrimitive().getAsString();
          try {
              return apiClient.parseDateOrDatetime(str);
          } catch (RuntimeException e) {
              throw new JsonParseException(e);
          }
      }
docs: Deserialize
  
  @param json Json element
  @param date Type
  @param context Json Serialization Context
  @return Date
  @throws JsonParseException if fail to parse