Hi everyone, so amazing we have a slack to talk ab...
# general
a
Hi everyone, so amazing we have a slack to talk about contract testing, I have two questions • The provider driven approach, is just possible if I have a OpenApi file, and just for rest APIs? • Can I create tests to validate requestBody expected from the provider? ◦ And if the provider add a new required field in the requestBody of the request, how can I create a test that can catch if this new required field will introduce a breaking change in the consumer?
y
a
Thanks @Yousaf Nabi (pactflow.io), But I din't find answer yet for the second part 1.
A provider might make a change (e.g., remove or rename a field, or change an endpoint) that breaks an existing consumer
But imagine that I have a POST request, can I create tests to validate the payload input of this POST request? and if yes if the provider introduce a new required field that (will break the client) in the requestBody this will be detected by pact?
y
it will yes, you can test it out, the provider would get feedback that the change would impact consumers and would need to co-ordinate the change appropriately. ( few different options here, such as allowing the breaking change with co-ordinated development and a co-ordinated deployment at the same time with a short downtime period, making it optional until all consumers are using it, then enforce as required, to allow for continual delivery with zero downtime. obviously you’d need to consider what the provider does in the case of not getting the value from the consumer and have a sensible default whilst optional )
a
Thank you, this is amazing, just to confirm. Yes, I can identify consumer breaking changes introducing a new required field in requestBody of the POST request, but this is true just for rest api and if I have a open api specification file, and using pactflow, is that right? Is there any prediction that this will also be possible for graphql, grpc or pub/sub (Event Driven Architecture)?
y
currently only openapi is supported on the provider side https://docs.pactflow.io/docs/bi-directional-contract-testing/contracts/oas we do wish to extend to further formats in future but no concrete plans other than feature requests on the PactFlow roadmap.
a
Thank you