Skip to content

Conversation

@JordonPhillips
Copy link
Contributor

This fixes a number of bugs uncovered by protocol tests in path serialization.

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

* shape. This may use native types or invoke complex type serializers to
* manipulate the dataSource into the proper input content.
*/
private static class HttpMemberSerVisitor extends ShapeVisitor.Default<String> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved all of this to a visitor from the hodgepodge methods above. The move to the visitor was a single commit, and behavioral changes are in other commits.

Comment on lines +9 to +12
RFC3339 = "%Y-%m-%dT%H:%M:%SZ"
# Same as RFC3339, but with microsecond precision.
RFC3339_MICRO = "%Y-%m-%dT%H:%M:%S.%fZ"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These were pulled from botocore, but given more specific names.

@JordonPhillips JordonPhillips force-pushed the fix-path-ser branch 2 times, most recently from 24be60e to 6482d73 Compare January 18, 2023 17:12
nateprewitt
nateprewitt previously approved these changes Jan 18, 2023
Copy link
Contributor

@nateprewitt nateprewitt left a comment

Choose a reason for hiding this comment

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

One question, apologies I didn't catch it during the last review. Once that's answered though, the rest of this looks good to me.

if context.transport_request.url.path:
endpoint.url.path += context.transport_request.url.path
endpoint.url.query = context.transport_request.url.query
endpoint.url.host = context.transport_request.url.host + endpoint.url.host
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I understand what's happening here. Why are we concatenating two hosts and what's the expected outcome? Is context.transport_request.url.host a prefix in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, the hostLabel trait allows for setting an endpoint prefix, so this is just accounting for that.

This updates the protocol tests to parse any timestamps inside the
generator and output a constructor rather than delegating the parsing
to python. This was already being done in the structure generator
for default values, so this shares that effort.
This updates unix timestamp serialization to omit fractional seconds
when that fraction is 0.
@JordonPhillips
Copy link
Contributor Author

@jonemo I had to rebase, but all the changes I've made in response to your comments are in the latest commit.

nateprewitt
nateprewitt previously approved these changes Jan 23, 2023
@JordonPhillips JordonPhillips merged commit 1aea04c into develop Jan 24, 2023
@JordonPhillips JordonPhillips deleted the fix-path-ser branch January 24, 2023 17:33
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