Skip to content
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

Support service renames when flattening namespaces #760

Merged
merged 2 commits into from
Apr 6, 2021

Conversation

srchase
Copy link
Contributor

@srchase srchase commented Apr 5, 2021

Adds support for service renames (#734) when using the flattenNamespaces transformer.

Any shapes that have been configured on the service to be renamed will also be flattened into the target namespace.

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

@srchase srchase requested a review from kstich April 5, 2021 23:22
Copy link
Contributor

@JordonPhillips JordonPhillips left a comment

Choose a reason for hiding this comment

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

This could use a doc update. I don't think it's necessarily obvious behavior.

@srchase srchase requested a review from JordonPhillips April 6, 2021 14:13
@srchase srchase merged commit 58d5b41 into main Apr 6, 2021
@srchase srchase deleted the flatten-namespaces-rename branch April 6, 2021 16:08
@@ -164,9 +164,18 @@ private ShapeId updateNamespace(ShapeId shapeId, String namespace) {
return shapeWalker.walkShapes(service).stream()
.filter(FunctionalUtils.not(Prelude::isPreludeShape))
.map(shape -> Pair.of(shape.getId(), updateNamespace(shape.getId(), config.getNamespace())))
.map(pair -> applyServiceRenames(pair, service))
Copy link
Member

Choose a reason for hiding this comment

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

Nit: ideally we can destructure pairs before calling methods with them. That would give the left and right shape ID a name so it's easier to understand the code.

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.

3 participants