Hello, I have a swagger.json and a pact file (see...
# pactflow
c
Hello, I have a swagger.json and a pact file (see attachments). If I publish them to Pactflow, I get the following strange error (see attached screenshot): Validator Error Cannot read properties of undefined (reading 'type') This error does not seem to be one of those "Contract Incompatibility Messages", which are listed here: https://docs.pactflow.io/docs/user-interface/bi-directional/ Could it be that this might point to an exception thrown inside the Pactflow? Is something wrong with one or both of my files which causes Pactflow to throw an exception or something? To reproduce the error, just publish both of the files to Pactflow server.
b
I'd say you are right. Can you run your oas through a validation tool to check its not missing a field?
It may be the pact is missing something.
c
I just checked it with the editor.swagger.io online editor and validator and the syntax of my swagger file has indeed an error (see the screenshot). I have the following section in the file: "security": [ { "OAuth2": [ "OAuth2" ] } ] But my file misses the "secritySchemes" section that defines the "OAuth2" security scheme. So, if I add the following section to my file, the file is shown as valid and also Pactflow no longer reports that error "Cannot read properties of undefined (reading 'type')". Thank you for the hint
👍 1
m
Thanks for confirming - we have added an item to the backlog to help differentiate OAS validation errors vs comparison errors
c
That's great, thank you too.
👍 1