pact-foundation / pact-specification

Describes the pact format and verification specifications
MIT License
295 stars 28 forks source link

Question: providerStates allowed in any contract? #89

Open scraymondjr opened 3 years ago

scraymondjr commented 3 years ago

The spec README seems to indicate that providerState will be updated to providerStates for all contracts here, but it seems that language implementations are only updating the field for Message contracts (example commit).

Should providerStates be available for Interaction and Message contracts or is it correct that provider states with multiple states with params is only supported for Message types?

uglyog commented 3 years ago

providerState is used in older versions (V1, V2) of the pact files. Versions V3+ it is the plural form.

Message pacts only exist with V3 (V1 and V2 are HTTP only), so should always use the plural with multiple values. However, if the spec version is set to V2 for HTTP pacts, it must use the single form.