Skip to content

Conversation

@JordonPhillips
Copy link
Contributor

This adds a trait for event stream protocol tests as well as an initial batch of tests for restJson1. These can be used to assert an implementation is compliant with the protocol.


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

@JordonPhillips JordonPhillips requested a review from a team as a code owner October 21, 2025 14:20
@JordonPhillips JordonPhillips force-pushed the event-stream-protocol-tests branch 2 times, most recently from e07f711 to 022d9a1 Compare October 23, 2025 15:43
appliesTo: "client"
}
{
id: "MalformedEventTypeOutput"
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably there are some below, but if there aren't, I'd be good to test malformed input, e.g, invalid type (boolean given where string expected), and similar.

@JordonPhillips JordonPhillips force-pushed the event-stream-protocol-tests branch from 022d9a1 to 70de99a Compare October 28, 2025 10:18
@JordonPhillips
Copy link
Contributor Author

JordonPhillips commented Oct 28, 2025

Regarding blobs - in existing protocol tests we do not base64 encode byte strings. I this test, for example, you can see that the byte string data in params is not encoded. It is encoded in the body bytes because that is how it is expected to be within the JSON. These tests don't have the raw value of the headers, so there's nowhere to show its encoded form.

EDIT: I changed my mind on this. The tests that don't have base64 representing bytes should. That can't be changed now, but we don't have to introduce more of this.

One addition that was made to the spec was to allow including the entire event bytes. These tests were written before that, so they aren't there. But I can add them. It's not really useful for serialization comparisons, but it is useful for deserialization tests, so I can go ahead and add them.

This adds blob support to NodeMapper, serializing to and from base64
encoded string nodes.
@sugmanue sugmanue merged commit 69cfbb4 into main Oct 29, 2025
12 checks passed
@sugmanue sugmanue deleted the event-stream-protocol-tests branch October 29, 2025 20:37
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