-
Notifications
You must be signed in to change notification settings - Fork 248
chore(cli): added support for api keys in query params #8892
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if (convertedSecurityScheme == undefined) { | ||
throw new Error(`Security scheme conversion failed for ${key}: ${JSON.stringify(securityScheme)}`); | ||
} | ||
if (convertedSecurityScheme == null) { | ||
return []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's intended to be the difference between this and the == null
check below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wasn't thinking about the null conditional block - was just trying to solve the undefined case. What happened was the returned schema came out as undefined, then when we try to access .type
in the code just below we get the error in the CLI output as Cannot read properties of undefined (reading 'type')
. This was just hoping to be an earlier error pitstop that would clarify that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
caught up sync about the glorious null vs undefined check and == / === in js
passwordEnvVar: basicSecuritySchemeNamingAndEnvvar?.password?.env | ||
}); | ||
} else { | ||
throw new Error(`Unsupported HTTP scheme: ${securityScheme.scheme}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's log the key in here too
queryParameterName: securityScheme.name | ||
}); | ||
} else { | ||
throw new Error(`Unsupported API key location ${key}: ${securityScheme.in}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to dig in at some point about how we surface CLI errors, I feel like there's a juicier way to do this and make it nicely formatted. But this is okay for now I think
This PR is stale because it has been open 25 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
This PR was closed because it has been inactive for 5 days after being marked stale. |
Description
A client introduced a new security schema:
However, we didn't support this and the error thrown wasn't clear.
Changes Made
Testing