Postman collection Authorization not present in documentation headers

3.2k Views Asked by At

I have started using Postman to map out my API and also wanted have a quick, easy way to document it and share it.

My API is using JWT for auth and this token needs to be present in each request except login.

In order to keep it DRY I have used Postman collection Authorization as explained on their blog http://blog.getpostman.com/2017/12/13/keep-it-dry-with-collection-and-folder-elements/

Example of how I set up collection authorization type bearer

This header is being used by my API as type "Inherit auth from parent" and this works with no problems during my requests.

But if I choose to view collection in browser this header is not displayed in the request or examples see screenshot.

Collection documentation as viewed in web

Here is the cURL request in Postman: curl -X GET \ https://example.api/v1/auth/user \ -H 'Content-Type: application/json'

Is it possible to display the auth header while using the collection settings or I should add the header myself for each request in order to make sure that this is added in the examples and documentation?

Edit: I've found that if I hover over the Authorization header I get the following message:

This temporary header is generated by Postman and is not saved with your request.

Here is a screenshot from the app with Postman collection temporary headers.

2

There are 2 best solutions below

1
On

If you are setting up that JWT Token as request headers then it should get displayed in the documentation. Below are the Steps how i am generating and setting up jwt token:

  1. Login api to generate jwt token.
  2. saving that token as environment
  3. variable Using that variable in each request which requires
    Authorization header.

please see the screenshot enter image description here

0
On

This issue will fix in 2 or 3 mounths.

You can track the issue status in https://github.com/postmanlabs/postman-app-support/projects/40#card-33062423