thedevsaddam / docgen

Transform your postman collection to HTML/Markdown documentation
MIT License
967 stars 134 forks source link

Response examples do not show request body #28

Closed mnich0ls closed 4 years ago

mnich0ls commented 4 years ago

First off, this is a great little tool. I love it!

The "examples" for a request do not include the request body for each response example. I see how I can work around it by creating a new top-level request for each example, but it seems to clutter the interface in Postman by having to create a lot of requests for each API, rather than using the examples concept that seems to solve that problem quite nicely. I'm happy to reorganize my requests and APIs, but I'm curious if there's a way to have an optional flag to also include the request body for each example?

My API folders and routes in Postman: image

An example request/response in Postman: image

The resulting markdown without the request body: image

Thanks!

thedevsaddam commented 4 years ago

Assuming you are talking about including the request body.

The documentation should add the request body. Please check the input JSON file.

Input:

Screenshot 2020-05-07 10 31 09

Markdown documentation:

Screenshot 2020-05-07 10 31 59

HTML documentation:

Screenshot 2020-05-07 10 31 26

Unfortunately, I could not simulate the response, but it will work fine.

Docgen version: v2.3 Support postman collection version > 2.1

Thanks for the appreciation!

mnich0ls commented 4 years ago

I believe what you demonstrated is that the request body is shown for the “main” request, but they are not shown for the “examples” for the request. I can send more screen shots later this morning when I’m at my computer, if that helps.

I also need to get more familiar with better ways of organizing my collection. I’m using Postman “requests” to define specific routes of my API, rather than define many requests with different examples for the same route, if that makes sense..

mnich0ls commented 4 years ago

The examples for a request: image image

Examples show up in the documentation as "responses" not as "examples" as they're named in Postman.

thedevsaddam commented 4 years ago

Please use the latest v3.0.0-rc

curl https://raw.githubusercontent.com/thedevsaddam/docgen/v3/install.sh -o install.sh && sudo chmod +x install.sh && sudo ./install.sh

Don't forget to provide feedback and close the opened issue.

mnich0ls commented 4 years ago

I will try this today. Thank you!

mnich0ls commented 4 years ago

This is great @thedevsaddam. I have some other suggestions, but I will put them in a new issue.