docgen icon indicating copy to clipboard operation
docgen copied to clipboard

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

Open HerveMorosini opened this issue 4 years ago • 5 comments

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.

HerveMorosini avatar Jan 26 '21 06:01 HerveMorosini

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

thedevsaddam avatar Jan 26 '21 08:01 thedevsaddam

Hi @thedevsaddam I will do.

HerveMorosini avatar Jan 26 '21 08:01 HerveMorosini

@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.

HerveMorosini avatar Jan 26 '21 09:01 HerveMorosini

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

louagej avatar Feb 16 '21 08:02 louagej

@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.

furick1 avatar Aug 04 '21 00:08 furick1