{"action":"created","issue":{"url":"https://api.github.com/repos/dreamhead/moco/issues/237","repository_url":"https://api.github.com/repos/dreamhead/moco","labels_url":"https://api.github.com/repos/dreamhead/moco/issues/237/labels{/name}","comments_url":"https://api.github.com/repos/dreamhead/moco/issues/237/comments","events_url":"https://api.github.com/repos/dreamhead/moco/issues/237/events","html_url":"https://github.com/dreamhead/moco/issues/237","id":323498477,"number":237,"title":"What should I do if I want to make the response json contain some values in the request json?","user":{"login":"yqleng1987","id":39183352,"avatar_url":"https://avatars2.githubusercontent.com/u/39183352?v=4","gravatar_id":"","url":"https://api.github.com/users/yqleng1987","html_url":"https://github.com/yqleng1987","followers_url":"https://api.github.com/users/yqleng1987/followers","following_url":"https://api.github.com/users/yqleng1987/following{/other_user}","gists_url":"https://api.github.com/users/yqleng1987/gists{/gist_id}","starred_url":"https://api.github.com/users/yqleng1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yqleng1987/subscriptions","organizations_url":"https://api.github.com/users/yqleng1987/orgs","repos_url":"https://api.github.com/users/yqleng1987/repos","events_url":"https://api.github.com/users/yqleng1987/events{/privacy}","received_events_url":"https://api.github.com/users/yqleng1987/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-16T07:25:45Z","updated_at":"2018-05-22T08:37:50Z","closed_at":null,"author_association":"NONE","body":"In my scenario, the request is json and the response is json too.\r\nFor example:\r\n```\r\n[\r\n  {\r\n    \"request\" :\r\n    {\r\n      \"method\" : \"post\",\r\n      \"uri\" : \"/test\",\r\n      \"json\" :\r\n      {\r\n        \"t1\" : \"111\",\r\n        \"t2\" : \"222\"\r\n      }\r\n    },\r\n    \"response\" :\r\n    {\r\n      \"json\" :\r\n      {\r\n        \"t1\" : \"111_test\",\r\n        \"t2\" : \"222_test\"\r\n      }\r\n    }\r\n  }\r\n]\r\n```\r\n\r\nNow I want to make the response json customized based on the json request. I know there is a feature \"template\" but how can we combine \"template\" with the response json?"},"comment":{"url":"https://api.github.com/repos/dreamhead/moco/issues/comments/390909361","html_url":"https://github.com/dreamhead/moco/issues/237#issuecomment-390909361","issue_url":"https://api.github.com/repos/dreamhead/moco/issues/237","id":390909361,"user":{"login":"yqleng1987","id":39183352,"avatar_url":"https://avatars2.githubusercontent.com/u/39183352?v=4","gravatar_id":"","url":"https://api.github.com/users/yqleng1987","html_url":"https://github.com/yqleng1987","followers_url":"https://api.github.com/users/yqleng1987/followers","following_url":"https://api.github.com/users/yqleng1987/following{/other_user}","gists_url":"https://api.github.com/users/yqleng1987/gists{/gist_id}","starred_url":"https://api.github.com/users/yqleng1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yqleng1987/subscriptions","organizations_url":"https://api.github.com/users/yqleng1987/orgs","repos_url":"https://api.github.com/users/yqleng1987/repos","events_url":"https://api.github.com/users/yqleng1987/events{/privacy}","received_events_url":"https://api.github.com/users/yqleng1987/received_events","type":"User","site_admin":false},"created_at":"2018-05-22T08:37:50Z","updated_at":"2018-05-22T08:37:50Z","author_association":"NONE","body":"In mock server, we can define any values in the response json .\r\nHowever, sometimes we can define any values of some fields in the response json and sometimes we need to define the value of some fields based on some values in the request json.\r\n\r\nFor example:\r\nThe request json looks like:\r\n \"json\" :\r\n      {\r\n        \"name\" : \"Jerry\",\r\n        \"phone\" : \"345201234\"\r\n      }\r\n\r\nThe response json should be like: (we need to keep the fields \"name\" and \"phone\" are the same as request and other fields like \"manager\" could have any faked values)\r\n \"json\" :\r\n      {\r\n        \"name\" : \"Jerry\",\r\n        \"phone\" : \"345201234\",\r\n         \"manager\" : \"Tom\",\r\n         \"Salary\" : \"10000\"\r\n      }"}}
{"actor":{"display_login":"yqleng1987"}}