Hey everyone! :wave: I'm popping in to see if ther...
# pactflow
r
Hey everyone! 👋 I'm popping in to see if there's something I'm missing. When I run
@pactflow/swagger-mock-validator
(versions attempted:
11.3
and
12.1
) I get an error when it tries to identify my security scheme for some endpoints in my openapi.json; I get
cannot read property type of undefined at isApiKeySecuritySchemeInHeaderOrQuery
. This makes sense--some of my endpoints are public and don't have a security scheme definition associated with them. My understanding may be incorrect, but I thought that public apis don't need to have an explicitly defined security scheme in openpai3. I'm unable to share the openapi def as it's work stuff. Is this an issue in the code (I notice if I deep dive and just change
scheme.type
to
scheme?.type
on the apiKey and http securityScheme validators all is well with the world) or with my understanding of openapi? If it's an issue with the code, I'm happy to submit a PR to update! Thanks!
y
Hey up Randy, It would be worth raising an issue on the repo, and a pull request would be welcome. May be best to start with a test case to show the issue, in the PR, in the existing test suite. Appreciate you can’t share your own api. We have friends in the the world of OpenAPI who can get eyes over the issue. It’s the weekend now for our Aussie engineers, so you may have to wait until early next week for some input. Hope that helps!
r
@Yousaf Nabi (pactflow.io) that makes sense, thanks! it's closing on the weekend for me (and vacation next week) so I'll try to kick off the convo next week, but may be when I return from vacation. Definitely open to starting with a convo around a test case.
🙌 2
msn island 1
m
That would be great, 🙏