-
Notifications
You must be signed in to change notification settings - Fork 24
Update traits to allow for dynamically discoverable implementations #395
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
Changes from all commits
a2c694b
3af374e
a33dcb9
1753210
5dfbbc4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,7 @@ | |
| INITIAL_RESPONSE_EVENT_TYPE, | ||
| get_payload_member, | ||
| ) | ||
| from .traits import EVENT_HEADER_TRAIT | ||
| from smithy_core.traits import EventHeaderTrait | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for my understanding, is the EventHeaderTrait ever used outside of an Event Stream implementation? Is this just being ported back to consolidate all the traits together or is there another theoretical library we'd use this in?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is only ever used by event streams, yes. But it could be used if we had an alternative event stream format or something like that. I've kept all the traits in core because so far we're only using traits from Smithy's default set of traits. But we could conceivably split them up too. |
||
|
|
||
| INITIAL_MESSAGE_TYPES = (INITIAL_REQUEST_EVENT_TYPE, INITIAL_RESPONSE_EVENT_TYPE) | ||
|
|
||
|
|
@@ -158,7 +158,7 @@ def read_struct( | |
| headers_deserializer = EventHeaderDeserializer(self._headers) | ||
| for key in self._headers.keys(): | ||
| member_schema = schema.members.get(key) | ||
| if member_schema is not None and EVENT_HEADER_TRAIT in member_schema.traits: | ||
| if member_schema is not None and EventHeaderTrait in member_schema: | ||
| consumer(member_schema, headers_deserializer) | ||
|
|
||
| if self._payload_deserializer: | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!