Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public void serializeMembers(${shapeSerializer:T} serializer) {
private void writeMemberSerialization(JavaWriter writer) {
boolean isError = shape.hasTrait(ErrorTrait.class);

for (var member : shape.members()) {
for (var member : CodegenUtils.getSortedMembers(shape)) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this alphanumerically sort structure and union members? Or does it return those in model order / idx order if available?

var memberName = symbolProvider.toMemberName(member);
// if the shape is an error we need to use the `getMessage()` method for message field.
if (isError && memberName.equalsIgnoreCase("message")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,22 +200,22 @@ public Schema schema() {

@Override
public void serializeMembers(ShapeSerializer serializer) {
serializer.writeList($SCHEMA_SPARSE_LIST, sparseList, sparseList.size(), SharedSerde.SparseStringListSerializer.INSTANCE);
serializer.writeMap($SCHEMA_SPARSE_MAP, sparseMap, sparseMap.size(), SharedSerde.SparseStringMapSerializer.INSTANCE);
serializer.writeList($SCHEMA_SPARSE_LIST_OF_SPARSE_MAP, sparseListOfSparseMap, sparseListOfSparseMap.size(), SharedSerde.SparseListOfSparseMapSerializer.INSTANCE);
serializer.writeList($SCHEMA_NON_SPARSE_LIST_OF_NON_SPARSE_MAP, nonSparseListOfNonSparseMap, nonSparseListOfNonSparseMap.size(), SharedSerde.NonSparseListOfNonSparseMapSerializer.INSTANCE);
if (nonSparseList != null) {
serializer.writeList($SCHEMA_NON_SPARSE_LIST, nonSparseList, nonSparseList.size(), SharedSerde.NonSparseStringListSerializer.INSTANCE);
}
serializer.writeList($SCHEMA_SPARSE_LIST, sparseList, sparseList.size(), SharedSerde.SparseStringListSerializer.INSTANCE);
if (nonSparseMap != null) {
serializer.writeMap($SCHEMA_NON_SPARSE_MAP, nonSparseMap, nonSparseMap.size(), SharedSerde.NonSparseStringMapSerializer.INSTANCE);
}
serializer.writeMap($SCHEMA_SPARSE_MAP, sparseMap, sparseMap.size(), SharedSerde.SparseStringMapSerializer.INSTANCE);
if (nonSparseListOfSparseMap != null) {
serializer.writeList($SCHEMA_NON_SPARSE_LIST_OF_SPARSE_MAP, nonSparseListOfSparseMap, nonSparseListOfSparseMap.size(), SharedSerde.NonSparseListOfSparseMapSerializer.INSTANCE);
}
serializer.writeList($SCHEMA_SPARSE_LIST_OF_SPARSE_MAP, sparseListOfSparseMap, sparseListOfSparseMap.size(), SharedSerde.SparseListOfSparseMapSerializer.INSTANCE);
if (sparseMapOfNonSparseList != null) {
serializer.writeMap($SCHEMA_SPARSE_MAP_OF_NON_SPARSE_LIST, sparseMapOfNonSparseList, sparseMapOfNonSparseList.size(), SharedSerde.SparseMapOfNonSparseListSerializer.INSTANCE);
}
serializer.writeList($SCHEMA_NON_SPARSE_LIST_OF_NON_SPARSE_MAP, nonSparseListOfNonSparseMap, nonSparseListOfNonSparseMap.size(), SharedSerde.NonSparseListOfNonSparseMapSerializer.INSTANCE);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ public Schema schema() {
@Override
public void serializeMembers(ShapeSerializer serializer) {
serializer.writeString($SCHEMA_REQUIRED_STRING, requiredString);
serializer.writeBoolean($SCHEMA_REQUIRED_PRIMITIVE, requiredPrimitive);
if (optionalString != null) {
serializer.writeString($SCHEMA_OPTIONAL_STRING, optionalString);
}
serializer.writeBoolean($SCHEMA_REQUIRED_PRIMITIVE, requiredPrimitive);
if (sparseList != null) {
serializer.writeList($SCHEMA_SPARSE_LIST, sparseList, sparseList.size(), SharedSerde.SparseStringListSerializer.INSTANCE);
}
Expand Down
Loading