OpenAPI 3.0 support for basic bearer auth security type#3
OpenAPI 3.0 support for basic bearer auth security type#3jpettit wants to merge 4 commits intoemanualjade:masterfrom
Conversation
|
@ehmicky - Could you take a look and lmk? |
| return secParamsA | ||
| } | ||
|
|
||
| const getSecDefs = function({ securityDefinitions, securitySchemes }) { |
There was a problem hiding this comment.
This isn't a good solution for checking 2.0 and 3.0 specs. Just throwing up the most basic PR here.
|
Thanks for this PR! OpenAPI 2.0 is not supportedCurrently only OpenAPI 2.0 is supported, which is why neither I am unfortunately wondering if adding support for only those two properties is a good idea and I will try to explain why (however thanks again for spending time on this). Supporting those two properties will only add very partial support for OpenAPI 3.0. If your specification is using OpenAPI 3.0, it will most likely crash because of other OpenAPI 3.0-specific properties. The current OpenAPI normalization code is 2.0-specific. Instead of mixing OpenAPI 2.0 and 3.0 inside the same code, I think it might be better to separate those into two folders, and a third folder for shared code. To go this road would require a PR adding OpenApi 3.0 as a whole, which is quite a lot of work. This is actually on my todo-list but this might take me some time until I am done. I will update The alternative would be to add bits and pieces of OpenAPI 3.0 logic into the current OpenAPI 2.0 logic, and splitting it later, which does not seem the right way to go about it. Solution to your initial issueNow the good news: it turns out you might actually already be able to use This project use OpenAPI to generate random HTTP requests based on the OpenAPI So the way to use call:
headers.authorization: Bearer TOKENProblemOne issue you will encounter is that if your specification is OpenAPI 3.0, it will most likely crash. Until I add support for OpenAPI 3.0, the only way around it is to use a converter like this to transform it to OpenAPI 2.0. |
|
Thank you for taking the time to respond. There is much to unpack here. Do you have a better way to contact you to discuss some of these things? Discord? Slack? |
|
@jpettit I am not sure I will have time for instant messaging. However would emails work for you? |
|
@ehmicky It could - however, the persistent state and creation of channel topics in something like Slack is nice and would scale beyond two contributors to a project. What is a good email for you? |
|
I appreciate your interest in this project. I just created a Gitter room. However I am going for a hike whole day tomorrow and I will celebrate on Sunday, so I will probably only be available on that chat room on Monday unfortunately. I can check it between two things during the week-end though (although I will only be able to chat asynchronously). |
When attempting to use the
components.securitySchemesdefinition in OAPI 3.0 I get the following error. This stubs in basic support and is probably a starting point for 2.0 support (not tested)?This allows a task to define an auth header as such:
authHeader.tasks.yml
openapi.yml 3.0 example