{"action":"created","issue":{"url":"https://api.github.com/repos/melezhik/swat/issues/20","labels_url":"https://api.github.com/repos/melezhik/swat/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/melezhik/swat/issues/20/comments","events_url":"https://api.github.com/repos/melezhik/swat/issues/20/events","html_url":"https://github.com/melezhik/swat/issues/20","id":130325549,"number":20,"title":"Неуказанные параметры при вызове модуля.","user":{"login":"ivanych","id":466311,"avatar_url":"https://avatars.githubusercontent.com/u/466311?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanych","html_url":"https://github.com/ivanych","followers_url":"https://api.github.com/users/ivanych/followers","following_url":"https://api.github.com/users/ivanych/following{/other_user}","gists_url":"https://api.github.com/users/ivanych/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanych/subscriptions","organizations_url":"https://api.github.com/users/ivanych/orgs","repos_url":"https://api.github.com/users/ivanych/repos","events_url":"https://api.github.com/users/ivanych/events{/privacy}","received_events_url":"https://api.github.com/users/ivanych/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"melezhik","id":988105,"avatar_url":"https://avatars.githubusercontent.com/u/988105?v=3","gravatar_id":"","url":"https://api.github.com/users/melezhik","html_url":"https://github.com/melezhik","followers_url":"https://api.github.com/users/melezhik/followers","following_url":"https://api.github.com/users/melezhik/following{/other_user}","gists_url":"https://api.github.com/users/melezhik/gists{/gist_id}","starred_url":"https://api.github.com/users/melezhik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melezhik/subscriptions","organizations_url":"https://api.github.com/users/melezhik/orgs","repos_url":"https://api.github.com/users/melezhik/repos","events_url":"https://api.github.com/users/melezhik/events{/privacy}","received_events_url":"https://api.github.com/users/melezhik/received_events","type":"User","site_admin":false},"milestone":null,"comments":7,"created_at":"2016-02-01T10:42:46Z","updated_at":"2016-02-01T11:33:49Z","closed_at":null,"body":"Допустим, некий метод в моём API принимает два параметра. Параметры необязательные и независимые.\r\n\r\nЯ делаю сват-модуль, описывающий этот метод:\r\n\r\n```\r\ncurl_params=\" \\\r\n--data-urlencode 'param_1=%param_1%' \\\r\n--data-urlencode 'param_2=%param_2%' \\\r\n}\r\n```\r\n\r\nЕсли я вызову модуль так:\r\n\r\n```\r\nrun_swat_module(\r\n    GET => '/method',\r\n    {   \r\n      param_1 => 'value_1',\r\n    },\r\n);\r\n```\r\n\r\nто сгенерируется такой запрос:\r\n\r\n```\r\nGET /method?param_1=value_1&param2=%param_2%\r\n```\r\n\r\nТ.е. второй параметр тоже будет добавлен в запрос, причем, значением его будет полная ерунда.\r\n\r\nМожно при вызове модуля задать второй параметр равным пустой строке, но это неудобно делать, потому что придется зря указывать кучу пустых параметров, в тех вызовах, в которых эти параметры не нужны.\r\n\r\nМожно ли сделать так, чтобы неуказанные в вызове параметры вообще не вставлялись в генерируемый запрос? Ну, или, по крайней мере, пусть вставляются с пустым значением."},"comment":{"url":"https://api.github.com/repos/melezhik/swat/issues/comments/177928541","html_url":"https://github.com/melezhik/swat/issues/20#issuecomment-177928541","issue_url":"https://api.github.com/repos/melezhik/swat/issues/20","id":177928541,"user":{"login":"ivanych","id":466311,"avatar_url":"https://avatars.githubusercontent.com/u/466311?v=3","gravatar_id":"","url":"https://api.github.com/users/ivanych","html_url":"https://github.com/ivanych","followers_url":"https://api.github.com/users/ivanych/followers","following_url":"https://api.github.com/users/ivanych/following{/other_user}","gists_url":"https://api.github.com/users/ivanych/gists{/gist_id}","starred_url":"https://api.github.com/users/ivanych/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivanych/subscriptions","organizations_url":"https://api.github.com/users/ivanych/orgs","repos_url":"https://api.github.com/users/ivanych/repos","events_url":"https://api.github.com/users/ivanych/events{/privacy}","received_events_url":"https://api.github.com/users/ivanych/received_events","type":"User","site_admin":false},"created_at":"2016-02-01T11:33:49Z","updated_at":"2016-02-01T11:33:49Z","body":"Ну т.е. да, обнулять плейсхолдеры - это однозначно, а убирать параметры совсем - можно опционально."}}