Skip to content

Ensure that AuthSchemes added to Endpoint builder retain parameter ordering #1591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 25, 2023
Merged
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 @@ -19,10 +19,12 @@

import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;
import java.util.stream.Collectors;
import software.amazon.smithy.model.FromSourceLocation;
import software.amazon.smithy.model.SourceLocation;
Expand Down Expand Up @@ -71,7 +73,8 @@ private Endpoint(Builder builder) {
builder.authSchemes.copy().stream()
.map(
authScheme -> {
Map<Identifier, Literal> base = new LinkedHashMap<>();
Map<Identifier, Literal> base = new TreeMap<>(
Comparator.comparing(Identifier::asString));
base.put(Identifier.of("name"), Literal.of(authScheme.left.asString()));
base.putAll(authScheme.right);
return Literal.record(base);
Expand Down