postmanlabs / postman-app-support

Postman is an API platform for building and using APIs. Postman simplifies each step of the API lifecycle and streamlines collaboration so you can create better APIs—faster.
https://www.postman.com
5.84k stars 839 forks source link

"Save as example" alters the response body #12667

Open PaulAnderson-One opened 8 months ago

PaulAnderson-One commented 8 months ago

Is there an existing issue for this?

Describe the Issue

run a request, enjoy the response body. Then "Save as example", but see that the body is arbitrarily pruned.

Some Json elements just disappear

Steps To Reproduce

  1. open existing request
  2. run the request. Inspect the body
  3. click "Save as example" - the body is altered (exactly what I don't want

Screenshots or Videos

before save as example after save as example

Operating System

macOS

Postman Version

10.23.0. also in 10.23.5

Postman Platform

Postman App

User Account Type

Signed In User

Additional Context?

this sounds exactly like an issue that was closed last year. Mystified . . . . not the expected behavior at all

coditva commented 8 months ago

@PaulAnderson-One Can you confirm if the response body that you see before saving as an Example has duplicate keys in the JSON? I think the keys that you see missing are the ones which are duplicated in the response. As you can't have duplicate keys in JSON, they get removed when saving as an Example.

Let me know if the issue is something else.