{"action":"created","issue":{"url":"https://api.github.com/repos/Codearte/accurest/issues/42","labels_url":"https://api.github.com/repos/Codearte/accurest/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/Codearte/accurest/issues/42/comments","events_url":"https://api.github.com/repos/Codearte/accurest/issues/42/events","html_url":"https://github.com/Codearte/accurest/issues/42","id":63456628,"number":42,"title":"Handling of optional parameters from request body when generating wiremock stubs","user":{"login":"cbuleandra","id":8832176,"avatar_url":"https://avatars.githubusercontent.com/u/8832176?v=3","gravatar_id":"","url":"https://api.github.com/users/cbuleandra","html_url":"https://github.com/cbuleandra","followers_url":"https://api.github.com/users/cbuleandra/followers","following_url":"https://api.github.com/users/cbuleandra/following{/other_user}","gists_url":"https://api.github.com/users/cbuleandra/gists{/gist_id}","starred_url":"https://api.github.com/users/cbuleandra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbuleandra/subscriptions","organizations_url":"https://api.github.com/users/cbuleandra/orgs","repos_url":"https://api.github.com/users/cbuleandra/repos","events_url":"https://api.github.com/users/cbuleandra/events{/privacy}","received_events_url":"https://api.github.com/users/cbuleandra/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Codearte/accurest/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-21T21:32:19Z","updated_at":"2015-10-06T09:30:07Z","closed_at":"2015-10-06T07:01:53Z","body":"It is not currently possible to use the Groovy DSL for creating stub definitions with request bodies that  accept optional parameters. It would be nice if something like this could be defined using the Groovy DSL:\r\n```\r\n${$(client(~/('loanNumber': '[0-9]+')?/), server('\"loanNumber\": 321'))}\r\n```\r\nThis should then result in the following stub definition:\r\n```\r\n\"bodyPatterns\": [\r\n    { \"matches\": \"\\\\{(\\\"loanNumber\\\":\\\"[0-9]+\\\")?\\\\}\" }\r\n]\r\n```\r\nI guess nothing should have to change on the acceptance tests generation part.\r\n\r\nWhat do you think? If you're ok with this idea, I could start working on a pull request in the following days."},"comment":{"url":"https://api.github.com/repos/Codearte/accurest/issues/comments/145797243","html_url":"https://github.com/Codearte/accurest/issues/42#issuecomment-145797243","issue_url":"https://api.github.com/repos/Codearte/accurest/issues/42","id":145797243,"user":{"login":"cbuleandra","id":8832176,"avatar_url":"https://avatars.githubusercontent.com/u/8832176?v=3","gravatar_id":"","url":"https://api.github.com/users/cbuleandra","html_url":"https://github.com/cbuleandra","followers_url":"https://api.github.com/users/cbuleandra/followers","following_url":"https://api.github.com/users/cbuleandra/following{/other_user}","gists_url":"https://api.github.com/users/cbuleandra/gists{/gist_id}","starred_url":"https://api.github.com/users/cbuleandra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cbuleandra/subscriptions","organizations_url":"https://api.github.com/users/cbuleandra/orgs","repos_url":"https://api.github.com/users/cbuleandra/repos","events_url":"https://api.github.com/users/cbuleandra/events{/privacy}","received_events_url":"https://api.github.com/users/cbuleandra/received_events","type":"User","site_admin":false},"created_at":"2015-10-06T09:30:07Z","updated_at":"2015-10-06T09:30:07Z","body":"@marcingrzejszczak Look great, thanks! Great job, as always! :+1: "}}