-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into tjroach/prevent-loadCredential-double-contin…
…uation
- Loading branch information
Showing
5 changed files
with
161 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ | |
import org.junit.Test; | ||
import org.skyscreamer.jsonassert.JSONAssert; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Arrays; | ||
import java.util.Collections; | ||
import java.util.HashMap; | ||
|
@@ -154,9 +155,13 @@ public void serdeForNestedCustomTypes() throws JSONException, AmplifyException { | |
.customTypeSchema(phoneSchema) | ||
.build(); | ||
|
||
List<SerializedCustomType> additionalPhoneNumbers = new ArrayList<>(); | ||
additionalPhoneNumbers.add(phone); | ||
additionalPhoneNumbers.add(phone); | ||
Map<String, Object> contactSerializedData = new HashMap<>(); | ||
contactSerializedData.put("email", "[email protected]"); | ||
contactSerializedData.put("phone", phone); | ||
contactSerializedData.put("additionalPhoneNumbers", additionalPhoneNumbers); | ||
SerializedCustomType contact = SerializedCustomType.builder() | ||
.serializedData(contactSerializedData) | ||
.customTypeSchema(contactSchema) | ||
|
@@ -314,6 +319,14 @@ private CustomTypeSchema customTypeSchemaForContact() { | |
.isCustomType(true) | ||
.isRequired(true) | ||
.build()); | ||
contactFields.put("additionalPhoneNumbers", CustomTypeField.builder() | ||
.name("additionalPhoneNumbers") | ||
.targetType("Phone") | ||
.javaClassForValue(Map.class) | ||
.isCustomType(true) | ||
.isArray(true) | ||
.isRequired(true) | ||
.build()); | ||
return CustomTypeSchema.builder() | ||
.name("Contact") | ||
.pluralName("Contacts") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters