I just started playing with pactflow cli but while...
# pactflow
t
I just started playing with pactflow cli but while trying to publish a contract to our broker, I get the following error:
Copy code
./pact/bin/pactflow publish-provider-contract ./<contract>.json --broker-base-url https://<url>.<http://pactflow.io/|pactflow.io/> --provider "<provider>" --provider-app-version 0.0.1
Error making request to https://<url>.<http://pactflow.io/provider-contracts/provider/<provider>/publish|pactflow.io/provider-contracts/provider/<provider>/publish> status=400 {"errors":{"_body.contract.contentType":["is missing"]}}
Copy code
provider
    .given("a test")
    .uponReceiving("a request")
    .withRequest({
      method: "GET",
      path: "/endpoint",
      headers: { 'Content-Type': 'application/json' }
    })
    .willRespondWith({
      body: like(jsonResponse),
      status: 200,
      headers: { 'Content-Type': 'application/json', 'Accept': 'application/json' }
    });
any idea what am I missing?
b
the test you have written is for a consumer contract
the CLI command you are using is to publish a provider contract.
use the
publish
command, not the
publish-provider-contract
command.
t
facepalm RTFM thanks!
😅 2
😆 1
🤔 i'm actually getting the same error
ok that worked!
Copy code
./pact/bin/pact-broker publish ~./<contract>.json --broker-base-url https://<url>.<http://pactflow.io/|pactflow.io/> --consumer-app-version 0.0.1
👍 3