You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a test for a Twirp client using this package, and have noticed it doesn't add the ;message=WhateverIAmSending parameter on the content type.
This results in the following failure:
Mock server failed with the following mismatches:
0) The following request was incorrect:
POST /twirp/twirp.example.haberdasher.Haberdasher/FindHat
1.0 Expected body with content type application/protobuf;message=FindHatRPC but was application/protobuf
In this case, the client is not configurable to override this, and it's not clear (at least to me) if this is the standard Twirp behaviour (perhaps it's a gRPC specific thing?), and so it seems it's not safe to assume this content-type.
The text was updated successfully, but these errors were encountered:
Without the message=WhateverIAmSending attribute, there is no way to know which message from the proto descriptors to use (there could be multiple interactions in the Pact file for different messages).
Yeah, I can see the challenge. This does seem to require clients to change their behaviour though to suit the test framework (in this case, requiring them to add content-type attributes that aren't there by default), which in general I'm not a fan of.
Given that we know the current interaction(s) being tested at that moment, why must we encode that information into the content-type header and not just compare it to the expected protobuf definition provided in the test?
I'm writing a test for a Twirp client using this package, and have noticed it doesn't add the
;message=WhateverIAmSending
parameter on the content type.This results in the following failure:
In this case, the client is not configurable to override this, and it's not clear (at least to me) if this is the standard Twirp behaviour (perhaps it's a gRPC specific thing?), and so it seems it's not safe to assume this content-type.
The text was updated successfully, but these errors were encountered: