RapiDoc icon indicating copy to clipboard operation
RapiDoc copied to clipboard

Small quality of life fixes

Open sanscontext opened this issue 2 years ago • 8 comments

This PR:

  • ✔️ Adds a link to the #auth anchor on the "no api key set" message, so that readers get a CTA how to fix it. After: (I don't have a non-edited version to screenshot for a Before) image

  • ✔️ Renders the bearerFormat string as the field hint text, for HTTP Bearer type auth, if one is set. (If not set, uses the original api-token.) Before: image After: image

  • ✔️ Similarly, renders the bearerFormat string as the noun in the instructional text, if set. (If not set, uses the original "Token String".) Before: image After: image

  • ⚠️ Attempts to check if there are >1 of a type of security scheme, and add the ${v.securitySchemeId} if there are, except I couldn't get this working or troubleshoot effectively with my rudimentary JS skills. Not working right now, but when it's done it would look something like this: Before: two different auth formats with the same name, so you have to use the descriptive text to tell them apart. image After: much easier to see that these are different image

Thanks all!

sanscontext avatar Jul 12 '23 00:07 sanscontext

Screenshots of before and after would be appreciate @sanscontext :)

AdrianMachado avatar Jul 12 '23 02:07 AdrianMachado

cc @mrin9

AdrianMachado avatar Jul 12 '23 02:07 AdrianMachado

Thanks @AdrianMachado , I added some before/after screenshots, trying to limit it to just what I've touched in this PR.

I was thinking about the bearerFormat part, and I'd actually want to see some examples of how it's used in the wild before assuming it'd be helpful here. The OAS isn't very prescriptive on how this should be used, and "Hint" isn't going to mean the same thing to everyone. Would this be something we could poll the Discord for, for examples?

sanscontext avatar Jul 12 '23 16:07 sanscontext

✔️ Adds a link to the #auth anchor on the "no api key set" message, so that readers get a CTA how to fix it. After: (I don't have a non-edited version to screenshot for a Before)

This may not be the case always. An user can always hide the auth section, in that case the link wont take it to anywhere

mrin9 avatar Jul 17 '23 14:07 mrin9

Thanks all, I'm open to additions to this PR. As I mentioned to @AdrianMachado, I'm not a developer so my changes here are rudimentary but high-impact on our end. It'd be nice not to have to add them to every new version of Rapidoc I pull down.

sanscontext avatar Jul 17 '23 16:07 sanscontext

I can take a look later this week

AdrianMachado avatar Jul 18 '23 18:07 AdrianMachado

Hey folks, it's been six months. Should I just close this?

sanscontext avatar Dec 19 '23 02:12 sanscontext