karthiks3000 / postman-doc-gen

Generate API documentation from a postman collection
MIT License
254 stars 45 forks source link

Description not formatted correctly #13

Closed catalinzanfir-am closed 3 years ago

catalinzanfir-am commented 3 years ago

When generating the documentation for the following collection, the description of the request is not formatted correctly as a table.

here's the collection

{
    "info": {
        "_postman_id": "14c846a4-35f3-4934-96c9-7918ced7d474",
        "name": "description not displayed",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "item": [
        {
            "name": "request name",
            "request": {
                "method": "POST",
                "header": [
                    {
                        "key": "Content-Type",
                        "name": "Content-Type",
                        "value": "application/json",
                        "type": "text"
                    }
                ],
                "body": {
                    "mode": "raw",
                    "raw": "{\n\t\"foo\": \"bar\"\n}"
                },
                "url": {
                    "raw": "http://{{url}}/v1/baz",
                    "protocol": "http",
                    "host": [
                        "{{url}}"
                    ],
                    "path": [
                        "v1",
                        "baz"
                    ]
                },
                "description": "| Field key | Mandatory | Value Type | Description |\n|---|:---:|:---:|---|\n| __field1__ | __YES__ | string | The baz reason. Ex: \"Did it foo\" / \"bar\" |\n| __field_2__ | __NO__ | boolean | Displayed or not |\n| __field3__ | __NO__ | integer | bazbuzz integer |"
            },
            "response": [
                {
                    "name": "example response 200OK ",
                    "originalRequest": {
                        "method": "POST",
                        "header": [
                            {
                                "key": "Content-Type",
                                "name": "Content-Type",
                                "value": "application/json",
                                "type": "text"
                            }
                        ],
                        "body": {
                            "mode": "raw",
                            "raw": "{\n\t\"foo\": \"bar\"\n}"
                        },
                        "url": {
                            "raw": "http://{{url}}/v1/baz",
                            "protocol": "http",
                            "host": [
                                "{{url}}"
                            ],
                            "path": [
                                "v1",
                                "baz"
                            ]
                        }
                    },
                    "status": "OK",
                    "code": 200,
                    "_postman_previewlanguage": "json",
                    "header": [
                        {
                            "key": "content-type",
                            "value": "application/json"
                        },
                    ],
                    "cookie": [],
                    "body": "{\n    \"foo\": \"bar\"\n}"
                }
            ]
        }
    ]
}