enzonotario / vitepress-openapi

Generate VitePress API Docs from OpenAPI specifications
https://vitepress-openapi.vercel.app
MIT License
54 stars 9 forks source link

Show description field of operation parameters #102

Closed MasterCarl closed 3 weeks ago

MasterCarl commented 3 weeks ago

What would you like?

First of all, thank you for providing this great library!

It would be great to show operation parameter descriptions, e.g.

GetBooks

Parameters pageIndex: The number of the page to request. The page starts with the value 0 sort: The field to sort the results by. Prefix by "-" to invert the sort.

Why is this needed?

Just the name might not be sufficient for users to understand how to use a certain field. OpenAPI provides the description field for further context.

How could it be implemented?

Since the parameter name, required status, and example are already shown in the "try-it" section, it would make sense to show the description there as well.

Alternatively, parameters could be listed in a section above the response documentation.

Other information

I'd be happy to help with the implementation!

enzonotario commented 3 weeks ago

Hi @MasterCarl , thanks for the suggestion!

I found a small bug I introduced in the last release, which was causing the Parameters section to be hidden by default. I've fixed it in v0.0.3-alpha.45, and it already includes the Parameter Description. This might be what you were looking for. Can you please check and confirm?

If not, I'd be happy to see your contribution, and I'm here to help with anything you need. Thanks!

MasterCarl commented 3 weeks ago

Thank you very much for the quick fix! That is indeed what I was looking for 🔥