Hi all, quick query, if consumer is storing data i...
# pact-go
s
Hi all, quick query, if consumer is storing data in to DB without any handler service, how to generate the contract without calling handler's validation code? can we skip that to generate the json without using any code logic to check but go according to some json schema
m
mind clarifying the scenario? I’m not sure I follow sorry
s
Provider Step AWS Lambda produces a JSON file into AWS S3 Consumer Step S3 content is copied into DB by parsing the file and using SQL queries I want to publish a contract by Consumer, so the provider conforms to a model schema. Since there isn’t a code handler wrapper I can use to verify here, how to generate the contract on consumer side?
sorry for not making it clear, thanks Matt.
m
No worries
You can’t use JSON schema in place of Pact tests, but you could of course use it in a test if you wanted
Surely there is a part of your code base that knows how to parse such a data structure. That would be the target of your consumer test (it would also be a message Pact test, not a regular HTTP test in case you had thought that)
See https://docs.pact.io/getting_started/how_pact_works#how-to-write-message-pact-tests. If you can test the part of the code that generates the JSON (provide/producer side), but not the bit that writes to S3, then you should be good.
s
thanks Matt, will follow that. Cheers
👍 1