enzonotario / vitepress-openapi

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

Support body for "try it out" #42

Closed addshore closed 2 months ago

addshore commented 2 months ago

Follow on to https://github.com/enzonotario/vitepress-theme-openapi/issues/10

It would be great to allow trying out requests that have a body required.

Probably a first version of this would just provide a single text input box for the whole "body" to be provided.

Users could then easily copy and paste the example (probably json) body, and modify it

enzonotario commented 2 months ago

I've added support for this. You may want to use it as useTheme().setPlaygroundJsonEditorMode('text'), but I setted it as tree by default.

There are many things we can improve here:

Thanks!

addshore commented 2 months ago

Just tried it, and it works very well!!!