diff --git a/services-custom/dynamodb-mapper/pom.xml b/services-custom/dynamodb-mapper/pom.xml
index 40e82fdaca84..73f465cd6a5d 100644
--- a/services-custom/dynamodb-mapper/pom.xml
+++ b/services-custom/dynamodb-mapper/pom.xml
@@ -91,6 +91,7 @@
**/*WithoutJodaTimeTest.java
+ **/*WithoutJacksonDatabindTest.java
@@ -116,6 +117,28 @@
+
+
+ without-jackson-databind
+
+ test
+
+
+
+ **/*WithoutJacksonDatabindTest.java
+
+
+ *WithoutJacksonDatabindTest
+
+ com.fasterxml.jackson.core:jackson-databind
+
+
+ true
+
+
+
@@ -179,6 +202,13 @@
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+ test
+ junitjunit
diff --git a/services-custom/dynamodb-mapper/src/main/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBTypeConvertedJson.java b/services-custom/dynamodb-mapper/src/main/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBTypeConvertedJson.java
new file mode 100644
index 000000000000..42fe345d56be
--- /dev/null
+++ b/services-custom/dynamodb-mapper/src/main/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBTypeConvertedJson.java
@@ -0,0 +1,104 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.mapper.dynamodb;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import software.amazon.awssdk.annotations.SdkPreviewApi;
+
+/**
+ * A simple JSON converter that uses the Jackson JSON processor.
+ *
+ *
It shares all limitations of that library. For more information about
+ * Jackson, see: http://wiki.fasterxml.com/JacksonHome
+ *
+ *
jackson-databind is not a dependency of the mapper. Applications that use this annotation must add
+ * {@code com.fasterxml.jackson.core:jackson-databind} 2.x to their classpath. Without it, the mapper throws a
+ * {@link DynamoDBMappingException} when it builds the model for a class that uses this annotation.
+ *
+ * @see software.amazon.awssdk.mapper.dynamodb.DynamoDBTypeConverted
+ */
+@SdkPreviewApi
+@DynamoDBTypeConverted(converter=DynamoDBTypeConvertedJson.Converter.class)
+@DynamoDBTyped(DynamoDBMapperFieldModel.DynamoDBAttributeType.S)
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD})
+public @interface DynamoDBTypeConvertedJson {
+
+ /**
+ * The value type to use when calling the JSON mapper's {@code readValue};
+ * a value of {@code Void.class} indicates to use the getter's type.
+ */
+ Class extends Object> targetType() default void.class;
+
+ /**
+ * JSON type converter.
+ */
+ final class Converter implements DynamoDBTypeConverter {
+ private final Class targetType;
+
+ public Converter(Class targetType, DynamoDBTypeConvertedJson annotation) {
+ this.targetType = annotation.targetType() == void.class ? targetType : (Class)annotation.targetType();
+ JacksonDatabindSupport.initialize();
+ }
+
+ @Override
+ public final String convert(final T object) {
+ try {
+ return JacksonDatabindSupport.writeValueAsString(object);
+ } catch (final Exception e) {
+ throw new DynamoDBMappingException("Unable to write object to JSON", e);
+ }
+ }
+
+ @Override
+ public final T unconvert(final String object) {
+ try {
+ return JacksonDatabindSupport.readValue(object, targetType);
+ } catch (final Exception e) {
+ throw new DynamoDBMappingException("Unable to read JSON string", e);
+ }
+ }
+ }
+
+}
diff --git a/services-custom/dynamodb-mapper/src/main/java/software/amazon/awssdk/mapper/dynamodb/JacksonDatabindSupport.java b/services-custom/dynamodb-mapper/src/main/java/software/amazon/awssdk/mapper/dynamodb/JacksonDatabindSupport.java
new file mode 100644
index 000000000000..43eb1ff39ad0
--- /dev/null
+++ b/services-custom/dynamodb-mapper/src/main/java/software/amazon/awssdk/mapper/dynamodb/JacksonDatabindSupport.java
@@ -0,0 +1,161 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.mapper.dynamodb;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import software.amazon.awssdk.annotations.SdkInternalApi;
+import software.amazon.awssdk.utils.Lazy;
+
+/**
+ * Calls the application's jackson-databind for {@link DynamoDBTypeConvertedJson}. The mapper doesn't depend on
+ * jackson-databind, so this class finds it on the classpath by name and calls it through reflection.
+ *
+ *
The calls and configuration match the v1 mapper's converter exactly, so the stored JSON is the same: one shared
+ * {@code ObjectMapper} with {@code FAIL_ON_UNKNOWN_PROPERTIES} disabled, {@code writeValueAsString(Object)} to write
+ * and {@code readValue(String, Class)} to read.
+ *
+ *
This class must not reference any jackson-databind type, so that it can be loaded without jackson-databind.
+ */
+@SdkInternalApi
+final class JacksonDatabindSupport {
+
+ private static final String OBJECT_MAPPER_CLASS = "com.fasterxml.jackson.databind.ObjectMapper";
+ private static final String DESERIALIZATION_FEATURE_CLASS = "com.fasterxml.jackson.databind.DeserializationFeature";
+
+ /**
+ * Checked with the mapper's own class loader, for the same reason as {@link JodaTimeSupport}.
+ */
+ private static final boolean AVAILABLE = isLoadable(OBJECT_MAPPER_CLASS);
+
+ private static final Lazy BRIDGE = new Lazy<>(ObjectMapperBridge::create);
+
+ private JacksonDatabindSupport() {
+ }
+
+ /**
+ * Returns whether jackson-databind is on the mapper's classpath.
+ */
+ static boolean isAvailable() {
+ return AVAILABLE;
+ }
+
+ /**
+ * Returns the exception to throw when a feature that needs jackson-databind is used without it.
+ *
+ * @param feature the feature that needs jackson-databind, for example {@code "@DynamoDBTypeConvertedJson"}
+ */
+ static DynamoDBMappingException missing(String feature) {
+ return new DynamoDBMappingException(
+ feature + " requires jackson-databind, which the mapper doesn't include. Add "
+ + "com.fasterxml.jackson.core:jackson-databind (Brazil package Jackson-databind) to the classpath, where "
+ + "the mapper's class loader can load it.");
+ }
+
+ /**
+ * Prepares the shared {@code ObjectMapper}, so that a missing or unusable jackson-databind fails when the mapper
+ * builds the model rather than on the first save or load.
+ */
+ static void initialize() {
+ BRIDGE.getValue();
+ }
+
+ /**
+ * Writes {@code value} as JSON, as {@code ObjectMapper.writeValueAsString} does.
+ *
+ * @throws Exception the exception jackson-databind threw
+ */
+ static String writeValueAsString(Object value) throws Exception {
+ ObjectMapperBridge bridge = BRIDGE.getValue();
+ return (String) invoke(bridge.writeValueAsString, bridge.objectMapper, value);
+ }
+
+ /**
+ * Reads {@code json} as {@code type}, as {@code ObjectMapper.readValue(String, Class)} does.
+ *
+ * @throws Exception the exception jackson-databind threw
+ */
+ @SuppressWarnings("unchecked")
+ static T readValue(String json, Class type) throws Exception {
+ ObjectMapperBridge bridge = BRIDGE.getValue();
+ return (T) invoke(bridge.readValue, bridge.objectMapper, json, type);
+ }
+
+ /**
+ * Calls {@code method} and rethrows what it threw, rather than an {@link InvocationTargetException}, so callers see
+ * the same exceptions as a direct call.
+ */
+ private static Object invoke(Method method, Object target, Object... args) throws Exception {
+ try {
+ return method.invoke(target, args);
+ } catch (InvocationTargetException e) {
+ Throwable cause = e.getCause();
+ if (cause instanceof Exception) {
+ throw (Exception) cause;
+ }
+ if (cause instanceof Error) {
+ throw (Error) cause;
+ }
+ throw e;
+ }
+ }
+
+ private static boolean isLoadable(String className) {
+ try {
+ Class.forName(className, false, JacksonDatabindSupport.class.getClassLoader());
+ return true;
+ } catch (ClassNotFoundException | LinkageError e) {
+ return false;
+ }
+ }
+
+ private static final class ObjectMapperBridge {
+ private final Object objectMapper;
+ private final Method writeValueAsString;
+ private final Method readValue;
+
+ private ObjectMapperBridge(Object objectMapper, Method writeValueAsString, Method readValue) {
+ this.objectMapper = objectMapper;
+ this.writeValueAsString = writeValueAsString;
+ this.readValue = readValue;
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ private static ObjectMapperBridge create() {
+ if (!AVAILABLE) {
+ throw missing("@DynamoDBTypeConvertedJson");
+ }
+ try {
+ ClassLoader loader = JacksonDatabindSupport.class.getClassLoader();
+ Class> mapperClass = Class.forName(OBJECT_MAPPER_CLASS, true, loader);
+ Class extends Enum> featureClass =
+ (Class extends Enum>) Class.forName(DESERIALIZATION_FEATURE_CLASS, true, loader);
+
+ Object objectMapper = mapperClass.getConstructor().newInstance();
+ mapperClass.getMethod("disable", featureClass)
+ .invoke(objectMapper, Enum.valueOf(featureClass, "FAIL_ON_UNKNOWN_PROPERTIES"));
+
+ return new ObjectMapperBridge(objectMapper,
+ mapperClass.getMethod("writeValueAsString", Object.class),
+ mapperClass.getMethod("readValue", String.class, Class.class));
+ } catch (ReflectiveOperationException | LinkageError | IllegalArgumentException e) {
+ throw new DynamoDBMappingException(
+ "@DynamoDBTypeConvertedJson found jackson-databind on the classpath but couldn't use it. It "
+ + "requires jackson-databind 2.x.", e);
+ }
+ }
+ }
+}
diff --git a/services-custom/dynamodb-mapper/src/test/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBMapperWithoutJacksonDatabindTest.java b/services-custom/dynamodb-mapper/src/test/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBMapperWithoutJacksonDatabindTest.java
new file mode 100644
index 000000000000..1702b6318b36
--- /dev/null
+++ b/services-custom/dynamodb-mapper/src/test/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBMapperWithoutJacksonDatabindTest.java
@@ -0,0 +1,146 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.mapper.dynamodb;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+import static org.assertj.core.api.Assertions.catchThrowable;
+import static org.junit.jupiter.api.Assumptions.assumeTrue;
+
+import java.util.Map;
+import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
+import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+
+/**
+ * Checks that the mapper works without jackson-databind, which it doesn't depend on, and that
+ * {@link DynamoDBTypeConvertedJson} fails with a clear message when the application doesn't provide it.
+ *
+ *
The {@code without-jackson-databind} surefire execution runs this class with jackson-databind removed from the
+ * classpath. Elsewhere, for example in an IDE, it is skipped.
+ */
+class DynamoDBMapperWithoutJacksonDatabindTest {
+
+ private final DynamoDBMapper mapper = DynamoDBMapper.builder()
+ .dynamoDbClient(DynamoDbClient.builder()
+ .region(Region.US_EAST_1)
+ .credentialsProvider(AnonymousCredentialsProvider.create())
+ .build())
+ .build();
+
+ @BeforeAll
+ static void requireJacksonDatabindExcluded() {
+ assumeTrue(Boolean.getBoolean("mapper.test.jacksonDatabindExcluded"),
+ "runs only in the without-jackson-databind surefire execution");
+ assertThatThrownBy(() -> Class.forName("com.fasterxml.jackson.databind.ObjectMapper"))
+ .as("jackson-databind must not be on the classpath of this test")
+ .isInstanceOf(ClassNotFoundException.class);
+ }
+
+ @Test
+ void isAvailable_withoutJacksonDatabind_returnsFalse() {
+ assertThat(JacksonDatabindSupport.isAvailable()).isFalse();
+ }
+
+ @Test
+ void getTableModel_withoutJsonAttribute_convertsWithoutJacksonDatabind() {
+ PlainItem item = new PlainItem();
+ item.setId("1");
+ item.setName("plain string");
+
+ DynamoDBMapperTableModel model = mapper.getTableModel(PlainItem.class);
+ Map stored = model.convert(item);
+
+ assertThat(stored.get("name").s()).isEqualTo("plain string");
+ assertThat(model.unconvert(stored).getName()).isEqualTo("plain string");
+ }
+
+ @Test
+ void getTableModel_withJsonAttribute_throwsMissingJacksonDatabindMessage() {
+ Throwable thrown = catchThrowable(() -> mapper.getTableModel(JsonItem.class));
+
+ assertThat(thrown).isInstanceOf(DynamoDBMappingException.class);
+ Throwable root = thrown;
+ while (root.getCause() != null) {
+ root = root.getCause();
+ }
+ assertThat(root)
+ .isInstanceOf(DynamoDBMappingException.class)
+ .hasMessageContaining("@DynamoDBTypeConvertedJson requires jackson-databind")
+ .hasMessageContaining("com.fasterxml.jackson.core:jackson-databind")
+ .hasMessageContaining("Jackson-databind");
+ }
+
+ public static class PlainItem {
+ private String id;
+ private String name;
+
+ @DynamoDBHashKey
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+ }
+
+ public static class JsonItem {
+ private String id;
+ private Payload payload;
+
+ @DynamoDBHashKey
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @DynamoDBTypeConvertedJson
+ public Payload getPayload() {
+ return payload;
+ }
+
+ public void setPayload(Payload payload) {
+ this.payload = payload;
+ }
+ }
+
+ public static class Payload {
+ private String value;
+
+ public String getValue() {
+ return value;
+ }
+
+ public void setValue(String value) {
+ this.value = value;
+ }
+ }
+}
diff --git a/services-custom/dynamodb-mapper/src/test/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBTypeConvertedJsonTest.java b/services-custom/dynamodb-mapper/src/test/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBTypeConvertedJsonTest.java
new file mode 100644
index 000000000000..fea560964a73
--- /dev/null
+++ b/services-custom/dynamodb-mapper/src/test/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBTypeConvertedJsonTest.java
@@ -0,0 +1,187 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.mapper.dynamodb;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.assertj.core.api.Assertions.assertThatThrownBy;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.JsonMappingException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Map;
+import org.junit.jupiter.api.Test;
+import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.dynamodb.DynamoDbClient;
+import software.amazon.awssdk.services.dynamodb.model.AttributeValue;
+
+class DynamoDBTypeConvertedJsonTest {
+
+ private final DynamoDBMapper mapper = DynamoDBMapper.builder()
+ .dynamoDbClient(DynamoDbClient.builder()
+ .region(Region.US_EAST_1)
+ .credentialsProvider(AnonymousCredentialsProvider.create())
+ .build())
+ .build();
+
+ @Test
+ void isAvailable_withJacksonDatabind_returnsTrue() {
+ assertThat(JacksonDatabindSupport.isAvailable()).isTrue();
+ }
+
+ @Test
+ void getTableModel_jsonAttribute_storesJsonStringAndReadsItBack() {
+ JsonItem item = new JsonItem();
+ item.setId("1");
+ item.setCurrency(new Currency(79.99, "USD"));
+
+ DynamoDBMapperTableModel model = mapper.getTableModel(JsonItem.class);
+ Map stored = model.convert(item);
+
+ assertThat(stored.get("currency").s()).isEqualTo("{\"amount\":79.99,\"unit\":\"USD\"}");
+ Currency loaded = model.unconvert(stored).getCurrency();
+ assertThat(loaded.getAmount()).isEqualTo(79.99);
+ assertThat(loaded.getUnit()).isEqualTo("USD");
+ }
+
+ @Test
+ void getTableModel_targetType_readsIntoTargetType() {
+ ListItem item = new ListItem();
+ item.setId("1");
+ CurrencyList currencies = new CurrencyList();
+ currencies.addAll(Arrays.asList(new Currency(1.0, "EUR"), new Currency(2.0, "GBP")));
+ item.setCurrencies(currencies);
+
+ DynamoDBMapperTableModel model = mapper.getTableModel(ListItem.class);
+ ListItem loaded = model.unconvert(model.convert(item));
+
+ assertThat(loaded.getCurrencies()).isInstanceOf(CurrencyList.class);
+ assertThat(loaded.getCurrencies()).extracting(Currency::getUnit).containsExactly("EUR", "GBP");
+ }
+
+ @Test
+ void unconvert_unknownProperty_isIgnored() {
+ Currency loaded = converter(Currency.class).unconvert("{\"amount\":1.0,\"unit\":\"EUR\",\"unknown\":true}");
+
+ assertThat(loaded.getUnit()).isEqualTo("EUR");
+ }
+
+ @Test
+ void unconvert_invalidJson_throwsMappingExceptionWithDatabindCause() {
+ assertThatThrownBy(() -> converter(Currency.class).unconvert("{not json"))
+ .isInstanceOf(DynamoDBMappingException.class)
+ .hasMessage("Unable to read JSON string")
+ .hasCauseInstanceOf(JsonProcessingException.class);
+ }
+
+ @Test
+ void convert_unserializableObject_throwsMappingExceptionWithDatabindCause() {
+ assertThatThrownBy(() -> converter(Object.class).convert(new Object()))
+ .isInstanceOf(DynamoDBMappingException.class)
+ .hasMessage("Unable to write object to JSON")
+ .hasCauseInstanceOf(JsonMappingException.class);
+ }
+
+ @SuppressWarnings({"unchecked", "rawtypes"})
+ private static DynamoDBTypeConvertedJson.Converter converter(Class type) {
+ try {
+ DynamoDBTypeConvertedJson annotation =
+ JsonItem.class.getMethod("getCurrency").getAnnotation(DynamoDBTypeConvertedJson.class);
+ return new DynamoDBTypeConvertedJson.Converter(type, annotation);
+ } catch (NoSuchMethodException e) {
+ throw new AssertionError(e);
+ }
+ }
+
+ public static class JsonItem {
+ private String id;
+ private Currency currency;
+
+ @DynamoDBHashKey
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @DynamoDBTypeConvertedJson
+ public Currency getCurrency() {
+ return currency;
+ }
+
+ public void setCurrency(Currency currency) {
+ this.currency = currency;
+ }
+ }
+
+ public static class ListItem {
+ private String id;
+ private CurrencyList currencies;
+
+ @DynamoDBHashKey
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ @DynamoDBTypeConvertedJson(targetType = CurrencyList.class)
+ public CurrencyList getCurrencies() {
+ return currencies;
+ }
+
+ public void setCurrencies(CurrencyList currencies) {
+ this.currencies = currencies;
+ }
+ }
+
+ public static class CurrencyList extends ArrayList {
+ }
+
+ public static class Currency {
+ private Double amount;
+ private String unit;
+
+ public Currency() {
+ }
+
+ Currency(Double amount, String unit) {
+ this.amount = amount;
+ this.unit = unit;
+ }
+
+ public Double getAmount() {
+ return amount;
+ }
+
+ public void setAmount(Double amount) {
+ this.amount = amount;
+ }
+
+ public String getUnit() {
+ return unit;
+ }
+
+ public void setUnit(String unit) {
+ this.unit = unit;
+ }
+ }
+}
diff --git a/services-custom/dynamodb-mapper/src/test/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBTypeConvertedJsonV1CompatibilityTest.java b/services-custom/dynamodb-mapper/src/test/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBTypeConvertedJsonV1CompatibilityTest.java
new file mode 100644
index 000000000000..97453e6e8223
--- /dev/null
+++ b/services-custom/dynamodb-mapper/src/test/java/software/amazon/awssdk/mapper/dynamodb/DynamoDBTypeConvertedJsonV1CompatibilityTest.java
@@ -0,0 +1,144 @@
+/*
+ * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License").
+ * You may not use this file except in compliance with the License.
+ * A copy of the License is located at
+ *
+ * http://aws.amazon.com/apache2.0
+ *
+ * or in the "license" file accompanying this file. This file is distributed
+ * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+package software.amazon.awssdk.mapper.dynamodb;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UncheckedIOException;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Stream;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+import software.amazon.awssdk.mapper.dynamodb.jsonfixtures.JsonModelFixtures;
+import software.amazon.awssdk.mapper.dynamodb.jsonfixtures.JsonModelFixtures.ReadCase;
+
+/**
+ * Checks {@link DynamoDBTypeConvertedJson.Converter} against JSON recorded from the v1 mapper.
+ *
+ *
{@code type_converted_json_fixture.json} holds the output of v1's
+ * {@code com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBTypeConvertedJson.Converter} from
+ * {@code aws-java-sdk-dynamodb} 1.12.797, running on jackson-databind 2.17.2, the version that release depends on,
+ * for every case in {@link JsonModelFixtures}. Write cases hold the JSON v1 wrote; read cases hold the object v1 read,
+ * serialized again with a default {@code ObjectMapper}.
+ */
+class DynamoDBTypeConvertedJsonV1CompatibilityTest {
+
+ private static final String FIXTURE = "type_converted_json_fixture.json";
+
+ /**
+ * Classes with properties that have a getter but no field. jackson-databind orders those properties by
+ * {@code Class.getDeclaredMethods()}, which the JVM doesn't specify, so their JSON can differ between JVMs even in
+ * v1. Cases that include them are compared without regard to property order.
+ */
+ private static final Set GETTER_ONLY_CLASSES = new HashSet<>(Arrays.asList(
+ "SubclassWithFieldsAndGetters", "OverridesGetter", "GetterOnly", "ManglesGetterNames", "IsGetters"));
+
+ private static final ObjectMapper JSON = new ObjectMapper();
+
+ private static final Map RECORDED = load();
+
+ private static final DynamoDBTypeConvertedJson ANNOTATION = annotation();
+
+ @DynamoDBTypeConvertedJson
+ private Object holder;
+
+ static Stream writeCases() {
+ List