Code Bug Fix: Set authorization for imported collections in Postman

Original Source Link

Current Workflow:
I develop an API backend and whenever I change or add a route, I want to update my Postman collection accordingly. Therefore I’ve setup a Swagger endpoint. I run the app, get the swagger.json and import it into Postman overriding the already existing collection (from a previous iteration).
My API uses Bearer Token authorization. So I create a token, and edit the collection’s authorization. I navigate to the request I want to test, edit its authorization to “Inherit auth from parent” and hit send.

Pain point:
I have to edit every request’s authorization manually, every time I re-import the collection. Because unfortunately there authorization for imported requests defaults to “No auth” (as opposed to created requests, which default to “Inherit auth from parent”).

Is there a way to set the authorization for all requests to “Inherit auth from parent” more easily?

The best thing I found was this thread:
The idea is to export the Collection as json, edit the auth via find and replace and then re-import it again. This is better than manually doing it for all requests, but still quite a pain.

Tagged :

Leave a Reply

Your email address will not be published. Required fields are marked *