dreamhead / moco

Easy Setup Stub Server
MIT License
4.36k stars 1.08k forks source link

May i use Template(Custom Variable) in JSON Response? #177

Open intofairy opened 7 years ago

intofairy commented 7 years ago

May i use Template(Custom Variable) in JSON Response? or other alternatives ?

json configration like this:

[

{
    "request": {
        "uri": "/template"
    },
    "response": {
        "json": {
            "result": 
            [
                {
                    "nodeId": 
                    {
                        "template": 
                        {
                            "with": "${foo}",
                            "vars": 
                            {
                                "foo": 
                                {
                                    "json_path": "$.splitInfo[0].nodeId"
                                }
                            }
                        }
                    }
                }
            ]
        }
    }
}

]

dreamhead commented 7 years ago

Try Custom Variable in Template