Consider authorization for OpenAPI request examples #606
-
It's very nice that Gitbook takes OpenAPI security schemes into account and shows them in OpenAPI blocks, but the code examples don't, which may cause significant confusion among users. In this screenshot, I'd expect the code example to include something like ![]() Ideally, the "Try it" module would also have the specified authorization method pre-checked, though I recognize this is harder since you use an external provider for it. ![]() |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Nice suggestions - I'll relay to the team! |
Beta Was this translation helpful? Give feedback.
-
Hey @arredond, sorry for the delay, here's what I found In your specification, it looks like both paths you provided in your screenshot don't have the If you add the "security": [
{
"bearerAuth": []
}
] Some of your endpoints already have the For the “Try it” feature, it displays available Let me know if you run into any other issues, happy to help! |
Beta Was this translation helpful? Give feedback.
Hey @arredond, sorry for the delay, here's what I found
In your specification, it looks like both paths you provided in your screenshot don't have the
security
property. Is this intentional?If you add the
security
property like this inside your paths, it will work with our updated OpenAPI blocks.Some of your endpoints already have the
security
property (see example)For the “Try it” feature, it displays available
securitySchemes
(even if they are not required for this endpoint). This is normal for testing the endpoint, but we won’t add it inside the block, as it could be misleading.Let me know if you run into any other issues, happy …