thedevsaddam / docgen

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

[v3] docgen does not take into account the subitems into postman collection #46

Open HerveMorosini opened 3 years ago

HerveMorosini commented 3 years ago

Hello! First of all,I would like to thank you for having developping this tool.

Here is the issue:

I have a postman collection with few subfolders such as

{
    "info": {
        "_postman_id": "",
        "name": "",
        "description": "",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "item": [
        {
            "name": "v1",
            "item": [
                {
                    "name": "1. title",
                    "item": [
                        {
                            "name": "1.2. title",
                            "item": [
                                {
                                    "name": "1.2.1. title",
                                    "item": [
                                        {
                                            "name": "1.2.1.1. title",
                                            "event": [...],
                                            "request": {...},
                                            "response": []
                                        },
...

When generating the HTML documentation from this collection, it generates only the first and second level of items.

Example:

image

Thanks for your help.

thedevsaddam commented 3 years ago

@HerveMorosini It would be great if you provide a postman example collection of the scenario so that I can regenerate and debug.

HerveMorosini commented 3 years ago

Hi @thedevsaddam I will do.

HerveMorosini commented 3 years ago

@thedevsaddam Here is an example of postman collection which not work with new version of gocgen. Example.postman_collection.zip Hope this will help! Thanks.

louagej commented 3 years ago

Hi @thedevsaddam ,

Could this be taken into account as a Proposal for improvement? I'm not able to run and build this code, but it might be a pretty simple fix. Maybe the Code in the function func (d *Documentation) buildSubChilditems(itm... the should refer not to it's own function, but it's parent function func (d *Documentation) build() buildSubChilditems image

Kind regards, Job

furick1 commented 3 years ago

@thedevsaddam does @louagej comment contain a valid fix to be able to show items in postman sub folders? The current build excludes requests from sub folders when converting to html. I am considering removing subfolders from our postman to be able to share with a broader audience via html who don't have postman installed or desire to download and import.