Save Response does not preserve variable token on URL

I believe this is a bug. When saving my response, environment variable tokens are preserved for Headers, however any such token on the URL of the request is fully resolved to its literal value. This means that environmental details, which you’d like to keep hidden when publishing your documentation with no environment, are disclosed in the code samples of the published documentation.

Please see the attached screen-shots. The first is the response itself. You can see that details of the request are encoded as tokens for headers and the URL. The second is the saved response. Tokenization is preserved for the headers, but the url shows the fully resolved target url, which you may not wish to disclose in your public documentation.

Edit: As I’m working with the Postman documentation feature, I’m finding that the Save Response feature is problematic in this respect in many areas. I can’t pin it down, but sometimes it replaces variable references with their literal values and sometimes it leaves the variable references in place. What I have found is that I need to go through my saved responses manually before I publish and restore the variable references so that they show up as such in the published documentation. Actually, when I restore these references, I need to code an “artificial syntax”, that is {reference} rather than {{reference}} because if I do the latter I will revisit the response at a later point and find that Postman has reverted the variable reference back to its literal contents.

If someone from Postman sees this - can you please correct your Save Response feature (or at least provide an option) so that it preserves variable references from the original request. Thank you.


Hi @yossigeretz. Welcome to the Postman Community.

I am trying to see how I can replicate this on my end. Have you noticed any pattern or the variable just abruptly stops being referenced?

1 Like

Here are the reproduction steps:

  1. Execute a request.
  2. Save the result.
  3. At this point {{variable}} references are preserved.
  4. Publish the collection with no environment
  5. Go back and look at the saved result
  6. You will find that the {{variable}} references in the saved response have been replaced with their literal values.
  7. At this point, those literal values have NOT been published, but the fact that they now exist in the saved response sets the stage for a debacle the next time you publish.

Thanks for looking into this. Give it a shot. Let me know if your experience is like mine. Thanks!

@gbadebo-bello Thanks for looking into this. Were you able to reproduce this?

Hey @yossigeretz. Sorry, I missed your last message.

When you say “Publish”, do you mean making the Workspace publish or Publish asin publish a collections documentation?

@gbadebo-bello - I mean publish the documentation. Thanks!

@postman-drop-team Does anyone from Postman monitor these questions?

@gbadebo-bello were you able to reproduce the issue? (When I said publish in my reproduction steps, I mean publish the documentation.) Thanks!

HI @yossigeretz. Sorry, I have been OOO for a while.

But, no. I was not able to reproduce this behaviour. Can you share a link to this documentation/collection? I am guessing it is public since you published the documentation?