Skip to content

Commit 2646bac

Browse files
rholshausenclaude
andcommitted
feat: Advertise interaction/request-response as a core catalogue entry
There is one INTERACTION catalogue entry per interaction type a Pact file can record, so add the request/response one alongside message and synchronous-message. The transport entries stay a separate concern - it is only history that the request/response interaction is the original Pact one carried over HTTP or HTTPS. This is the host half of the Phase 1 capability set in pact-plugins proposal 005: a plugin sees these names in hostCapabilities at InitPlugin, and declares the same names back for the interaction types it can handle. Must stay in step with Pact-JVM's interactionCatalogueEntries. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent e89cd48 commit 2646bac

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

rust/pact_matching/src/matchingrules.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ lazy_static! {
163163
/// Transport and interaction entries to add to the plugin catalogue, for the interaction types
164164
/// and transports this framework handles itself.
165165
///
166+
/// There is one interaction entry per interaction type a Pact file can record, and the transport
167+
/// entries are a separate concern - it is only history that the request/response interaction is
168+
/// the original Pact one carried over HTTP.
169+
///
166170
/// These are not matching capabilities and nothing dispatches to them - they exist so a plugin
167171
/// can ask, through `hostCapabilities` at `InitPlugin`, what the host it is running under can
168172
/// carry. Pact-JVM has registered them since before plugins had capability negotiation
@@ -174,6 +178,7 @@ lazy_static! {
174178
for (entry_type, key) in [
175179
(CatalogueEntryType::TRANSPORT, "http"),
176180
(CatalogueEntryType::TRANSPORT, "https"),
181+
(CatalogueEntryType::INTERACTION, "request-response"),
177182
(CatalogueEntryType::INTERACTION, "message"),
178183
(CatalogueEntryType::INTERACTION, "synchronous-message")
179184
] {
@@ -2611,7 +2616,13 @@ mod tests {
26112616
.collect::<HashSet<_>>();
26122617

26132618
expect!(advertised).to(be_equal_to(
2614-
["transport/http", "transport/https", "interaction/message", "interaction/synchronous-message"]
2619+
[
2620+
"transport/http",
2621+
"transport/https",
2622+
"interaction/request-response",
2623+
"interaction/message",
2624+
"interaction/synchronous-message"
2625+
]
26152626
.iter()
26162627
.map(|key| key.to_string())
26172628
.collect::<HashSet<_>>()

0 commit comments

Comments
 (0)