karthiks3000 / postman-doc-gen

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

Empty example response bodies causing TypeError failure #3

Closed akaczinski closed 4 years ago

akaczinski commented 4 years ago

Build: 1.0.2

Description: If a Postman collection is exported, and has an empty response body in an example, this application will fail when attempting to generate documentation.

The error logs: Traceback (most recent call last): File "postman_doc_gen\postman_doc_gen.py", line 27, in File "postman_doc_gen\document_generator.py", line 49, in generate_doc File "postman_doc_gen\document_generator.py", line 182, in add_items File "postman_doc_gen\document_generator.py", line 219, in add_apis File "postman_doc_gen\document_generator.py", line 252, in get_examples TypeError: must be str, not NoneType [17716] Failed to execute script postman_doc_gen

Example collection which causes failure: { "info": { "_postman_id": "8cc8adb1-0da4-48ca-99e1-f7e69b4e3f86", "name": "Example", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, "item": [ { "name": "Example", "request": { "method": "GET", "header": [], "url": { "raw": "http://example.com", "protocol": "http", "host": [ "example", "com" ] } }, "response": [ { "name": "Example", "originalRequest": { "method": "GET", "header": [], "url": { "raw": "http://example.com", "protocol": "http", "host": [ "example", "com" ] } }, "code": 404, "_postman_previewlanguage": null, "header": null, "cookie": [], "body": null } ] } ], "protocolProfileBehavior": {} }

karthiks3000 commented 4 years ago

@akaczinski I have fixed the bug with the latest release https://github.com/karthiks3000/postman-doc-gen/releases/tag/v1.0.3

karthiks3000 commented 4 years ago

Closing this since the issue has been fixed with the latest release