StydeNet / enlighten

Enlighten your APIs with auto-generated documentation
MIT License
575 stars 32 forks source link

Should be able to copy the request payload in json format #51

Open ajcastro opened 3 years ago

ajcastro commented 3 years ago

First of all, I would like to greet and thanks to the team of Enlighten... its workflow is the best!

I realized it is good if we also have a json version (or javascript object) of the request payload. This lets the front-end guys to copy the json format and easily start to build a request payload object in their code. Also this is also helpful to copy-paste sample data into Postman.

Please take note that json format and javascript objects are not totally the same, so there would be additional two formats.

Maybe we can have a toggle button whether we want to display the request payload in either html table(currently available), json or javascript code. I guess the json is the best default presentation.

Image of sample request payload presented in html table: image

ajcastro commented 3 years ago

It is also good to have json/javascript object presentation for the query parameters.

sileence commented 3 years ago

Hi @ajcastro, we'd have a look at that feature. It sounds interesting. If you'd like to contribute you can also:

Submit a pull request with the new feature or sponsor us in GitHub: https://github.com/sponsors/sileence

Thanks!