karthiks3000 / postman-doc-gen

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

Postman Environment Support #7

Closed rajib-raiyat closed 3 years ago

rajib-raiyat commented 3 years ago

Can you please make a environment support for your software ?

python postman_doc_gen.py [path/to/collection] -o [path/to/output/folder] -i [path/to/postman_enviroment]
karthiks3000 commented 3 years ago

@rajib-raiyat can you be more specific? The tool supports applying environments already

rajib-raiyat commented 3 years ago

@karthiks3000 Thanks for your support.

I have postman collections and in this collection I have some variables, suppose one of them {{base_url}}. So when I want to make a documentation there is no option(as far as I know) to set my postman environment with the collection in postman-doc-gen.

So as a result, I got the URL in documentation which looks like {{base_url}}/api/user. But If I can provide the environment then the URL will look like example.com/api/user

karthiks3000 commented 3 years ago

So the tool does support environment variables, but they are applied to the examples associated with each request.

To apply environment values to the examples, use the following command -

./postman_doc_gen [path/to/collection] -o [path/to/output/folder] -e [path/to/environment/json]

rajib-raiyat commented 3 years ago

OK thanks. But what if I want to use Build localy ? Or how to use this software in linux ?

karthiks3000 commented 3 years ago

The readme has the steps to build locally.

rajib-raiyat commented 3 years ago

Yes, I know how to build locally. But I want to use environment in build locally method. Which you describe in this comment.

karthiks3000 commented 3 years ago

You just modify the build locally command as per the above example

python postman_doc_gen [path/to/collection] -o [path/to/output/folder] -e [path/to/environment/json]