-
Notifications
You must be signed in to change notification settings - Fork 280
OpenAPI security
specification is not present in the hooks
#675
Comments
Hi, thanks for an interesting suggestion! This is not planned and unfortunately, I don't know about an easy workaround. One would be to write I'm not sure the filename is recorded in the BTW, I'd generalize this problem to:
I think we should make sure in the future hooks can somehow access the parse result. |
Thanks for the quick response. I went ahead with your suggestion and I'm able to get the full swagger definition with I also agree with your generalization of the problem. |
@tiagoalves Great, thanks! |
@artem-zakharchenko @kylef this could be solved if Dredd used API Elements as an internal data structure instead of the custom "transaction" abstraction it uses now. |
I have a similar problem to #454. I'm testing some APIs with an OpenAPI specification that use
security
to indicate how requests should be authenticated and I'd like to have access to that information in thetransaction
object that is passed to the hook callbacks.My goal is to dynamically add authentication information to the requests in the hooks. Specifying the authentication in a request-specific hook or in the command-line isn't an option for me since I'm trying to run Dredd generically for multiple APIs.
In the following code of the
dredd-transactions
project I can see thatparseResult
contains aauthSchemes
object which seems to be what I need: https://github.com/apiaryio/dredd-transactions/blob/master/src/dredd-transactions.coffee#L29However, in the subsequent line, that information is discarded.
Is this feature planned or is there a work-around?
Thank you and great job on Dredd!
The text was updated successfully, but these errors were encountered: