Hi team, I already have a OAS and wanna publish it...
# pactflow
r
Hi team, I already have a OAS and wanna publish it to pactflow. I’m wondering why it will give me this error?
Copy code
./pact/bin/pactflow publish-provider-contract ./openapi.yaml  --provider=CC-Go-Template-Service-Provider -a v0.01 --broker-base-url=<https://mydns.pactflow.io> -k $PACT_TOKEN --branch main --contentType=application/yaml --verification-exit-code=0
ERROR: "pactflow publish_provider_contract" was called with arguments ["./openapi.yaml", "--contentType", "application/yaml"]
Usage: "pactflow publish-provider-contract CONTRACT_FILE ... --provider=PROVIDER -a, --provider-app-version=PROVIDER_APP_VERSION -b, --broker-base-url=BROKER_BASE_URL"
PS: I’ve read the publish-provider-contract page and its repo, I’m wondering if it’s necessary to have the collection first and run the newman in CI then publish?
y
You are missing some properties. 👍🏽 --verification-results REPORT_PATH \ --verification-results-content-type REPORT_CONTENT_TYPE \ --verifier VERIFIER
You can provide any result file, even a plain text file if you do not have a codebase yet to verify
r
Copy code
./pact/bin/pactflow publish-provider-contract ./openapi.yaml  --provider=CC-Go-Template-Service-Provider -a v0.01 --broker-base-url=<https://mydns.pactflow.io> -k $PACT_TOKEN --branch main --contentType=application/yaml --verification-exit-code=0  --verification-results ./result.txt  --verification-results-content-type text/plain --verifier postman
ERROR: "pactflow publish_provider_contract" was called with arguments ["./openapi.yaml", "--contentType", "application/yaml"]
Usage: "pactflow publish-provider-contract CONTRACT_FILE ... --provider=PROVIDER -a, --provider-app-version=PROVIDER_APP_VERSION -b, --broker-base-url=BROKER_BASE_URL"
still same error🤔, and the consumer pact already published in pactflow.
m
I think
-a
should be
-b
(the version).
r
I think it’s -a
Copy code
Options:
      --provider=PROVIDER
              # The provider name
  -a, --provider-app-version=PROVIDER_APP_VERSION

  -b, --broker-base-url=BROKER_BASE_URL
Even I change to full-name, still same error:
Copy code
./pact/bin/pactflow publish-provider-contract ./openapi.yaml  --provider=CC-Go-Template-Service-Provider --provider-app-version=v0.01 --broker-base-url=<https://confluent.pactflow.io> -k $PACT_TOKEN --branch main --contentType=application/yaml --verification-exit-code=0  --verification-results ./result.txt  --verification-results-content-type text/plain --verifier postman
m
Ah sorry. It might have been the formatting of the output. Sorry I'm on mobile
r
no problem!
find out the problem, seems like the result must be json file:
--verification-results ./result.json
Thanks for your concern Yousaf, Matt!
m
Hmm I don't think it needs to be json 🤔
r
hmmmm, weird then, cause that’s the only change I made in the cmd line🤔
👀 1