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.85k stars 839 forks source link

support nested object in JSON data variable #3198

Open tommynsong opened 7 years ago

tommynsong commented 7 years ago

App Details:

Postman for Windows
Version 5.0.0
win32 10.0.14393 / x64

Issue Report:

  1. Did you encounter this recently, or has this bug always been there:
  2. Expected behaviour:
  3. Console logs (http://blog.getpostman.com/2014/01/27/enabling-chrome-developer-tools-inside-postman/ for the Chrome App, View->Toggle Dev Tools for the Mac app):
  4. Screenshots (if applicable)

I have the following JSON object that i would like to be able to use in Runner with my test script.

` { "default": { "frequencies": { "hourly": { "frequency": 6, "retention": 336, "archivalSPecs": {

            },
            "replicationSpecs": {

            },
            "allowedBackupWindows": {

            },
            "firstFullAllowedBackupWindows": {

            }
        }
    }
},
"standard": {
    "frequencies": {
        "hourly": {
            "frequency": 24,
            "retention": 336,
            "archivalSPecs": {

            },
            "replicationSpecs": {

            },
            "allowedBackupWindows": {

            },
            "firstFullAllowedBackupWindows": {

            }
        }
    }
},
"enhanced": {
    "frequencies": {
        "hourly": {
            "frequency": 12,
            "retention": 336,
            "archivalSPecs": {

            },
            "replicationSpecs": {

            },
            "allowedBackupWindows": {

            },
            "firstFullAllowedBackupWindows": {

            }
        }
    }
},
"ultimate": {
    "frequencies": {
        "hourly": {
            "frequency": 2,
            "retention": 336,
            "archivalSPecs": {

            },
            "replicationSpecs": {

            },
            "allowedBackupWindows": {

            },
            "firstFullAllowedBackupWindows": {

            }
        }
    }
}

} `

sdnts commented 7 years ago

@tommynsong We've been looking into having explicit types for variables eventually, but this isn't planned yet, so I'm adding this as a feature request. For the time being, you can JSON.stringify before storing the variable and JSON.parse before using it. We're aware that this isn't ideal, so we'll look into this :)

You can see the roadmap here: https://trello.com/b/4N7PnHAz/postman-roadmap-for-developers