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

Simplify implementation of rendering prefix headers #1841

Merged

Conversation

david-perez
Copy link
Contributor

The implementation that binds the target of
@httpPrefixHeaders-annotated member shapes is overly complex in that
it accounts for the possibility of it targeting a list shape. However,
@httpPrefixHeaders can only be applied to structure members targeting
map shapes:

The existing implementation likely came to be by copy-pasting the
RustWriter.renderHeaders extension function.

I've also taken the liberty of reformatting and renaming variables for
clarity and consistency.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

The implementation that binds the target of
`@httpPrefixHeaders`-annotated member shapes is overly complex in that
it accounts for the possibility of it targeting a list shape. However,
`@httpPrefixHeaders` can only be applied to structure members targeting
map shapes:

* https://awslabs.github.io/smithy/1.0/spec/core/http-traits.html#httpprefixheaders-trait
* https://awslabs.github.io/smithy/2.0/spec/http-bindings.html#httpprefixheaders-trait

The existing implementation likely came to be by copy-pasting the
`RustWriter.renderHeaders` extension function.

I've also taken the liberty of reformatting and renaming variables for
clarity and consistency.
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

Copy link
Collaborator

@jdisanti jdisanti left a comment

Choose a reason for hiding this comment

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

Nice!

@david-perez david-perez enabled auto-merge (squash) October 20, 2022 12:58
@github-actions
Copy link

A new generated diff is ready to view.

A new doc preview is ready to view.

@david-perez david-perez merged commit e74ecf3 into main Oct 20, 2022
@david-perez david-perez deleted the davidpz/simplify-implementation-of-rendering-prefix-headers branch October 20, 2022 13:29
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