@Override
  public T deserialize(final String topic, final byte[] bytes) {
    try {
      if (bytes == null) {
        return null;
      }

      // don't use the JsonSchemaConverter to read this data because
      // we require that the MAPPER enables USE_BIG_DECIMAL_FOR_FLOATS,
      // which is not currently available in the standard converters
      final JsonNode value = isJsonSchema
          ? JsonSerdeUtils.readJsonSR(bytes, MAPPER, JsonNode.class)
          : MAPPER.readTree(bytes);

      final Object coerced = enforceFieldType(
          "$",
          new JsonValueContext(value, schema)
      );

      if (LOG.isTraceEnabled()) {
        LOG.trace("Deserialized {}. topic:{}, row:{}", target, topic, coerced);
      }

      return SerdeUtils.castToTargetType(coerced, targetType);
    } catch (final Exception e) {
      // Clear location in order to avoid logging data, for security reasons
      if (e instanceof JsonParseException) {
        ((JsonParseException) e).clearLocation();
      }

      throw new SerializationException(
          "Failed to deserialize " + target + " from topic: " + topic + ". " + e.getMessage(), e);
    }
  }
@Test
  public void shouldDeserializedJsonArray() {
    // Given:
    final KsqlJsonDeserializer<List> deserializer = givenDeserializerForSchema(
        SchemaBuilder
            .array(Schema.OPTIONAL_INT64_SCHEMA)
            .build(),
        List.class
    );

    final byte[] bytes = serializeJson(ImmutableList.of(42, 42.000, "42"));

    // When:
    final Object result = deserializer.deserialize(SOME_TOPIC, bytes);

    // Then:
    assertThat(result, is(ImmutableList.of(42L, 42L, 42L)));
  }