pactflow / pact-protobuf-plugin

Pact plugin for Protobufs and gRPC
MIT License
16 stars 8 forks source link

Add support for collections injection for `fromProviderState` #73

Open eranberg opened 2 months ago

eranberg commented 2 months ago

I am trying to use fromProviderState for gRPC/protobuf to inject data into the request at verification time. This works great if you are injecting a singular value like String but doesn't work when trying to inject a collection (such as a List of Strings)

This however does work for the REST stack see usage of valueFromProviderState

I'm using a SpringBoot + JUnit5 + PactJVM + Pact protobuf plugin 0.5.1

From Ron:

That will only work for JSON, because JSON is not a well-structured format, and the provider state handler returns JSON so the values can be blindly injected. With Protobufs, that can't blindly work, the values have to transformed to match the Protobuf messages.

Is there a way to enhance the existing fromProviderState implementation to allow injection of collections? (maybe have something like collectionFromProviderState?)

mefellows commented 1 month ago

Bringing this issue into our sprint review for discussion.

github-actions[bot] commented 1 month ago

👋 Hi! The 'smartbear-supported' label has just been added to this issue, which will create an internal tracking ticket in PactFlow's Jira (PACT-2576). We will use this to prioritise and assign a team member to this task. All activity will be public on this ticket. For now, sit tight and we'll update this ticket once we have more information on the next steps.

See our documentation for more information.

mefellows commented 1 month ago

Just a note that we weren't able to review this in the next sprint. We will review this again in approximately 2 weeks.

mefellows commented 1 week ago

Work has begun on this ticket.