I would like to try out the bi directional functio...
# pactflow
m
I would like to try out the bi directional function of pactflow. I generate my OAS with annotations in my code so i do not have a YAML or JSON file to upload as this is generate on the swagger endpoint when the app is running. How do i then upload the correct OAS spec to pactflow. It is shown how to do it if you have a OAS spec first but not how you do it code first and document the spec in your code. Any help?
y
you should be able to build your code and generate the OAS file as an artefact. If not you could spin your app up, grab the payload from the swagger endpoint
We mention it in our guide here https://docs.pactflow.io/docs/workshops/bi-directional/step3#verifying-the-provider-contract
1. Generate the OAS from code. This is the most reliable, because whenever the implementation changes, the OAS will change with it. Tools like Spring Docs (Java) and Swashbuckle (.NET) will do this for you.
The actual mechanism depends on your tool
1
m
ok i'll check that one out