Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The EventParsingIterator implementation does not parse correctly events when their payload do not have the eventpayload property set. The current behavior is that if said property "eventpayload" is not present then it fallback to extracting the value from the headers, but this is not a reliable method for parsing event streams since seems that not all services uses this pattern to provide the events. One example is the InvokeModelWithResponseStream operation from bedrock-runtime service. To fix this we pretty much followed the specs found in the smithy reference: https://smithy.io/2.0/spec/streaming.html#eventpayload-trait#id6, which explains that when eventpayload and eventheader is not set for any of the members of the shape then, the payload itself should be considered as the top level shape structure to be parsed. The test implementation for eventstream have also been refactored as follow: - We now have to specify the rest protocol that the input test data will be using, and based on that protocol we have a factory method to create either a rest xml or rest JSON parser. - Instead of validating if a specific member is present to validate if the parsed data type is the correct one, we now validate each parsed member to make sure they are all parsed into the expected data type.
- Loading branch information