Brendan Donegan
03/30/2022, 7:31 PMEddie Stanley
03/30/2022, 7:35 PMEddie Stanley
03/30/2022, 7:37 PMBrendan Donegan
03/30/2022, 7:38 PMBrendan Donegan
03/30/2022, 7:39 PMEddie Stanley
03/30/2022, 7:42 PMBrendan Donegan
03/30/2022, 8:03 PMEddie Stanley
03/30/2022, 11:36 PMGET /foo
and in that test, the provider is assumed to respond with a 200
with the body 'x'. The consumer uploads the contract based on that single scenario.
The provider uploads it's OAS which says that GET /foo
can respond in two ways:
⢠With 200
and body 'x'
⢠With 400
and body 'y'
Will the the contract compatibilty check (run by PactFlow) alert us in this case? What if the response bodies are compatible but only the status codes differ?
As the development team maintaining the consumer, in this scenario we want to be told "Hey! You need to handle the case where the provider gives you a 400 back as well!".
NB: This illustrates (what in my eyes is) a major shortcoming of the regular (CDCT) contract testing:
⢠As the team developing the consumer, you need to remember to look at the OAS for the provider and make sure you exhaustively handle the status codes + respond body shapes it could return
⢠If the provider is updated to return new status codes / response bodies, that is a breaking change for the consumer. Yet the consumer will have no way of knowing about it & the team developing the provider won't know that they are potentially breaking things for their consumers! ā ļø
@Brendan Donegan what are your thoughts on this?Eddie Stanley
03/30/2022, 11:53 PMBrendan Donegan
04/01/2022, 7:53 PMEddie Stanley
04/01/2022, 10:36 PMYousaf Nabi (pactflow.io)
Yousaf Nabi (pactflow.io)
Eddie Stanley
05/02/2022, 11:58 PMUnless you have a specific business case to do some based on that 400 class of errorWell that's one good reason, but another reason is that if there's a new shape of 400 response, there's a possibility that you were previously making requests that could be now invalid.