Skip to content

Serialize structure members in schema order, not declaration order - #1344

Open
adwsingh wants to merge 1 commit into
mainfrom
adwsingh/sort-generated-serialize-members
Open

Serialize structure members in schema order, not declaration order#1344
adwsingh wants to merge 1 commit into
mainfrom
adwsingh/sort-generated-serialize-members

Conversation

@adwsingh

Copy link
Copy Markdown
Contributor

What behavior changes?

Serialize structure members in schema order, not declaration order

Why is this change needed?

So that adding changing the order of fields in the model doesn't change the order of serialization.

How was this validated?

List tests added, benchmarks run, or manual verification performed.

What should reviewers focus on?

Point reviewers to the files or sections that contain the interesting logic.

Additional Links

Related issues, design docs, or prior art.


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants