Hi All, quick question Does anyone of you have an ...
# pactflow
o
Hi All, quick question Does anyone of you have an explanation for this? I'm supposed to have the UI swagger. but I have No API definition provided.
y
Hey, How did you upload your contract, and what content type did you provide? Are you able to share your contract? I assume your OAS doesn't reference any external files, and is dereferenced? https://docs.pactflow.io/docs/bi-directional-contract-testing/contracts/oas/#document-limitations
o
Yes, this is the published OAS
y
Thanks for that 👍 How did you upload it? Just tested now
Copy code
pactflow publish-provider-contract \
    oas.yaml \
    --provider test \
    --provider-app-version 1.0.1-some-sha \
    --branch test \
    --content-type application/yaml \
    --verification-exit-code=0 \
    --verification-results oas.yaml \
    --verification-results-content-type application/yaml \
    --verifier test
o
like this. I don't see what's wrong with it 😑 pactflow publish-provider-contract ./tests/Pact/Consumer/Icp/provider/swagger/oas.yaml \ --broker-token \ --broker-base-url \ --provider ${PARTICIPANT} \ --provider-app-version ${VERSION} \ --branch ${BRANCH} \ --content-type CONTENT_TYPE \\\ --verification-exit-code=0 \\\\N --verification-results ./tests/Pact/Consumer/Icp/provider/collections/ContratStockreport.postman_collection.json \\ --verification-resultats-content-type REPORT_CONTENT_TYPE \ --verifier postman
y
you can't pass the word CONTENT_TYPE, you need to pass a valid mime-type
application/yaml
for your OAS and
application/json
for the collection, although you should be passing in the output of your test run, I assume with newman. as
text/plain
this param is also spelt incorrectly
--verification-resultats-content-type
it should be
--verification-results-content-type
o
It works. Thank you.
🙌 1
m
Another concern is how you missed the error code uploading. Did you do it by hand or via a pipeline? If the latter it seems you might not be checking the exit status
o
Via pipeline, Yes i will do that
👍 1