Hi, I'm trying to publish my contract using local ...
# pactflow
v
Hi, I'm trying to publish my contract using local cli ../pact/bin/pactflow.bat publish-provider-contract \ swagger.json \ --broker-base-url <<My Pacthflow host>> \ --broker-token "<<Token>>" \ --provider "pactblogsapi" \ --provider-app-version 3a0994c \ --branch pactblogsapi-main \ --content-type application/yaml \ --verification-exit-code=0 \ --verification-results report.txt \ --verification-results-content-type text/plain \ --verifier Schemathesis I'm getting error making request to https://compworld.pactflow.io/contracts/provider/pactblogsapi/version/3a0994c status=400 {"errors":{"verificationResults.content":["must be filled"]}} The file report.txt contrains verification result. Any suggestion to fix this?
y
Hey Vandana, that looks sensible, here is one I have from my history
Copy code
pactflow publish-provider-contract \
    products.yaml \
    --provider test \
    --provider-app-version 1.0.1-some-sha \
    --branch test \
    --content-type application/yaml \
    --verification-exit-code=0 \
    --verification-results products.yaml \
    --verification-results-content-type application/yaml \
    --verifier test
I'm cheating here and just sending the OAS as the verification report. I assume the folder you are in, contains both the swagger.json and and report.txt? I wonder if the pact ruby standalone is looking in its path where it lives, rather than where your pact file lives, and needs an absolute path, I wouldn't have thought that would be the case but will test out as I have a windows machine here Also top tip
` three backs (without the spaces) will provide a code block for you, that you can paste code snippets into 🙂 Makes it nicer on everyones eyes
I wonder if
../pact/bin/pactflow.bat
means its looking outside the folder or did you mean to write
./pact/bin/pactflow.bat
with your code being in x folder and
pact
being in the same folder as your code?
v
It gives same error with ./pact/bin/pactflow.bat
y
if you do
dir
in your console, do you see your
pact
folder and the
swagger.json
and
results.txt
?
v
I don't see pact folder but I see other two files
my oas is json, should the content-type be text/plain
?
y
from my testing, passing
application/yaml
is fine for a valid json document. Feel free to private message me your documents and I'll test on my windows and mac machines. Could you move the
pact
folder into the folder where your code is (where the
swagger.json
and
results.txt
reside)
v
I was able figure out my issue, my report.txt is blank at the location passed to the command
👍 2
y
wahey! so you just needed some content in the file
glad you are sorted