pactflow / swagger-mock-validator

Other
13 stars 4 forks source link

Feat: Support retrieving OAS provider contracts from PactFlow #45

Closed YOU54F closed 5 months ago

YOU54F commented 11 months ago

Feature: Support retrieving OAS provider contracts from PactFlow

Allowing users to retrieve both Pact's (#44) and Provider contracts from PactFlow, we would provide a much quicker route to users self-diagnosing and replaying of the verification results locally

Assuming the user has the following env vars set

and have access to the consumer and provider contract url's that they wish to verify

Provider

Consumer

/bin/swagger-mock-validator.mjs https://testdemo.pactflow.io/internal/contracts/bi-directional/provider/pact-provider-poc/version/64898db/consumer/pact-consumer-poc/version/9191e17/provider-contract https://testdemo.pactflow.io/pacts/provider/pact-provider-poc/consumer/pact-consumer-poc/version/9191e17

Notes

Leverages PactFlow internal url for BDCT

internal/contracts/bi-directional

Sample curl request

curl -H "Authorization: Bearer $PACT_BROKER_TOKEN" https://testdemo.pactflow.io/internal/contracts/bi-directional/provider/pact-provider-poc/version/64898db/consumer/pact-consumer-poc/version/9191e17/provider-contract | jq .

relies on the following resource

_embedded["providerContract"]["content"]