Ruud Welling
12/09/2025, 2:53 PMcurl -H "Accept: application/hal+json" -H "Authorization: Bearer $PACT_BROKER_TOKEN" https://${my_pact_org}.<http://pactflow.io/pacts/provider/${provider}/consumer/${consumer}/branch/main/latest|pactflow.io/pacts/provider/${provider}/consumer/${consumer}/branch/main/latest>"
To retrieve the latest version of a contract between two applications on the main branch.
This used to work fine for a long time, but since yesterday the response I get no longer contacts the pact interactions also the consumer and provider objects are missing in the json reponse.
Did this API change? Is there any other way to retrieve the latest pact (on main) for a pair of applications?Matt (pactflow.io / pact-js / pact-go)
Ruud Welling
12/10/2025, 7:12 AM{
"_embedded": {
"pacts": [
{
"createdAt": "2025-12-08T08:24:04+00:00",
"_embedded": {
"consumerVersion": {
"number": "34c0d03d099b60bb0cef8e45353496804ab34b33",
"_links": {
"self": {
"title": "Version",
"name": "34c0d03d099b60bb0cef8e45353496804ab34b33",
"href": "<https://myorg.pactflow.io/pacticipants/MyConsumer/versions/34c0d03d099b60bb0cef8e45353496804ab34b33>"
}
}
}
},
"_links": {
"self": {
"href": "<https://myorg.pactflow.io/pacts/provider/MyProvider/consumer/MyConsumer/version/34c0d03d099b60bb0cef8e45353496804ab34b33>",
"title": "Pact between MyConsumer (34c0d03d099b60bb0cef8e45353496804ab34b33) and MyProvider"
}
}
}
]
},
"_links": {
"self": {
"href": "<https://myorg.pactflow.io/pacts/provider/MyProvider/consumer/MyConsumer/branch/main/latest>",
"title": "All versions of the pact between MyConsumer and MyProvider"
},
"consumer": {
"href": "<https://myorg.pactflow.io/pacticipants/MyConsumer>",
"title": "Consumer",
"name": "MyConsumer"
},
"provider": {
"href": "<https://myorg.pactflow.io/pacticipants/MyProvider>",
"title": "Provider",
"name": "MyProvider"
},
"pact-versions": [
{
"href": "<https://myorg.pactflow.io/pacts/provider/MyProvider/consumer/MyConsumer/version/34c0d03d099b60bb0cef8e45353496804ab34b33>",
"title": "Pact",
"name": "Version 34c0d03d099b60bb0cef8e45353496804ab34b33 - 08/12/2025"
}
]
}
}Ruud Welling
12/10/2025, 7:12 AMpact-versions) then I do retrieve the full pact contractMatt (pactflow.io / pact-js / pact-go)
Matt (pactflow.io / pact-js / pact-go)
<https://myorg.pactflow.io/pacts/provider/MyProvider/consumer/MyConsumer/version/34c0d03d099b60bb0cef8e45353496804ab34b33> is definitely a pact URLMatt (pactflow.io / pact-js / pact-go)
Ruud Welling
12/10/2025, 12:36 PMMatt (pactflow.io / pact-js / pact-go)
I have previous responses of the API stored. so I am sure I received the actual pacts before.🤔
No, because I have this issue for all integrations (pairs of consumer/provider) that we have in our landscape (edited)yep sorry, was just a suggestion before I looked into the API itself.
Matt (pactflow.io / pact-js / pact-go)
Ruud Welling
12/11/2025, 9:49 AMMatt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Ruud Welling
12/11/2025, 2:49 PM{
"consumer": {
"name": "MyConsumer"
},
"interactions": [
{
"_comment": "omitted"
}
],
"metadata": {
"pact-jvm": {
"version": "4.6.17"
},
"pactSpecification": {
"version": "4.0"
}
},
"provider": {
"name": "MyProvider"
}
}
Note: The actual content of the interactions has been removed to keep this short.
Also my jq script removes the createdAt and _links keys so my script can easily check if there were changes (have not stored these values)Yousaf Nabi (pactflow.io)
Matt (pactflow.io / pact-js / pact-go)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Do we know what’s required to fix?Not yet without a root cause, could be a route clobber, and the routes need to be better defined, or smth else. Will have a goosey gander
Ruud Welling
12/12/2025, 1:35 PMRuud Welling
12/12/2025, 1:39 PMApi::Resources::PactVersionsForBranch and the preexisting one routed to Api::Resources::LatestPactYousaf Nabi (pactflow.io)
Api::Resources::LatestPact will return the full pact content, and Api::Resources::PactVersionsForBranch is designed to return an array of pacts of which latest returns only the latest, but not the full pact content (has a href, so the consumer can visit it) and reduces the payload when requesting all pact versions from a branch, rather than returning every pacts full content.
A workaround for the moment would be to fetch the latest pact url, and visit it in a two step process
LATEST_PACT_URL=$(curl -H "Accept: application/hal+json" -H "Authorization: Bearer $PACT_BROKER_TOKEN" https://${my_pact_org}.<http://pactflow.io/pacts/provider/${provider}/consumer/${consumer}/branch/main/latest|pactflow.io/pacts/provider/${provider}/consumer/${consumer}/branch/main/latest>" | jq '._links.pacts.[0].href' -r)
curl -H "Accept: application/hal+json" -H "Authorization: Bearer $PACT_BROKER_TOKEN" $LATEST_PACT_URLYousaf Nabi (pactflow.io)
main
https://${my_pact_org}.<http://pactflow.io/pacts/provider/${provider}/consumer/${consumer}/branch/latest|pactflow.io/pacts/provider/${provider}/consumer/${consumer}/branch/latest>
which will use the broker recorded property of your main branch, and not the named branch main
if you do that, the script will still work, when we remove the newly introduced overlapping routeYousaf Nabi (pactflow.io)
mainBranch propertyYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
/pact-versionsRuud Welling
12/15/2025, 8:18 AMYousaf Nabi (pactflow.io)