-
Notifications
You must be signed in to change notification settings - Fork 8
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
Issue with matching a list of enums #27
Comments
@Yu-Xie are you able to provide the proto file and test code? |
Hey folks, I'm running into the same issue. Any way I can help to fix it? Don't have any rust experience tho :( |
A reproducible example project will help us diagnose the problem and then work out how to fix it |
I'll try to produce something in the coming days |
Here's the sample:
|
Thank you for the sample project, I can replicate it with Rust code. |
I've fixed the encoding of repeated enum fields. @stan-is-hate the other issue is that this config does not make sense:
This is configuring the If you want to state that the
|
Thanks @rholshausen ! I've copied the structure of the example from the actual protos we use in our services. In our case |
I would just set the test up to accept at least one value. That will work with your current provider and work in the future. You can't do an |
Yeah, that's what I mean, how do I express "at least one value"? |
should do it. I'm currently adding two options to specify the min and max length as well. |
ah, interesting, so "type": "notEmpty('')" would process that it is a non-empty list, gotcha. Got confused at first :) |
what if the list contains structured elements (ie other protos), how would you define "at least one" in that case? If at all possible? |
I'm currently adding |
Repeated enums seem to work ok in my consumer test, thanks for a quick fix! |
Original issue: pact-foundation/pact-plugins#31
In the matcher do we support list of enums?
I’m getting this error --- is it because enum is not added to should_be_packed_type?
Failed to match the request message - BodyMismatches({"$.states": [BodyMismatch { path: "$.states[0]", expected: Some(b"ENUM_VAL_1"), actual: Some(b"0102"), mismatch: "Expected and actual field have different types: 1:(states, Varint, Enum) = ENUM_VAL_1 and 1:(states, LengthDelimited, Unknown) = 0102" }]})
The text was updated successfully, but these errors were encountered: