{"action":"created","issue":{"url":"https://api.github.com/repos/Codearte/accurest/issues/128","labels_url":"https://api.github.com/repos/Codearte/accurest/issues/128/labels{/name}","comments_url":"https://api.github.com/repos/Codearte/accurest/issues/128/comments","events_url":"https://api.github.com/repos/Codearte/accurest/issues/128/events","html_url":"https://github.com/Codearte/accurest/issues/128","id":102775807,"number":128,"title":"Array values in contracts which use regex results in invalid wiremock's definition","user":{"login":"adam-wojszczyk","id":4930054,"avatar_url":"https://avatars.githubusercontent.com/u/4930054?v=3","gravatar_id":"","url":"https://api.github.com/users/adam-wojszczyk","html_url":"https://github.com/adam-wojszczyk","followers_url":"https://api.github.com/users/adam-wojszczyk/followers","following_url":"https://api.github.com/users/adam-wojszczyk/following{/other_user}","gists_url":"https://api.github.com/users/adam-wojszczyk/gists{/gist_id}","starred_url":"https://api.github.com/users/adam-wojszczyk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adam-wojszczyk/subscriptions","organizations_url":"https://api.github.com/users/adam-wojszczyk/orgs","repos_url":"https://api.github.com/users/adam-wojszczyk/repos","events_url":"https://api.github.com/users/adam-wojszczyk/events{/privacy}","received_events_url":"https://api.github.com/users/adam-wojszczyk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Codearte/accurest/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-24T11:52:38Z","updated_at":"2015-10-02T18:46:47Z","closed_at":null,"body":"Contract:\r\n```groovy\r\nio.codearte.accurest.dsl.GroovyDsl.make {\r\n\r\n    priority 2\r\n    request {\r\n        method 'POST'\r\n        url '/partners'\r\n        headers {\r\n            header 'Content-Type': 'application/json'\r\n        }\r\n        body(\r\n\r\n                superuser_email: $(client(regex(email())), server('not.existing@user.com')),\r\n                payment_methods: ['BANK']\r\n        )\r\n    }\r\n\r\n    response {\r\n        status 201\r\n        headers {\r\n            header 'Location': 'http://localhost/partners/1000'\r\n        }\r\n    }\r\n}\r\n```\r\n\r\nIn wiremock's definition we find \"DslProperty(clientValue:BANK, serverValue:BANK)\":\r\n```json\r\n{\r\n    \"request\": {\r\n        \"method\": \"POST\",\r\n        \"headers\": {\r\n            \"Content-Type\": {\r\n                \"equalTo\": \"application/json\"\r\n            }\r\n        },\r\n        \"url\": \"/partners\",\r\n        \"bodyPatterns\": [\r\n            {\r\n                \"matches\": \"\\\\s*\\\\{\\\\s*\\\"superuser_email\\\"\\\\s*:\\\\s*\\\"?[_]*([a-z0-9]+(\\\\.|_*)?)+@([a-z][a-z0-9-]+(\\\\.|-*\\\\.))+[a-z]{2,6}\\\"?\\\\s*,\\\\s*\\\"payment_methods\\\"\\\\s*:\\\\s*\\\\[\\\\s*\\\"?DslProperty(clientValue:BANK, serverValue:BANK)\\\"?\\\\s*\\\\]\\\\s*\\\\}\\\\s*\"\r\n            }\r\n        ]\r\n    },\r\n    \"response\": {\r\n        \"status\": 201,\r\n        \"headers\": {\r\n            \"Location\": \"http://localhost/partners/1000\"\r\n        }\r\n    },\r\n    \"priority\": 2\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/Codearte/accurest/issues/comments/145122211","html_url":"https://github.com/Codearte/accurest/issues/128#issuecomment-145122211","issue_url":"https://api.github.com/repos/Codearte/accurest/issues/128","id":145122211,"user":{"login":"mariuszs","id":1623393,"avatar_url":"https://avatars.githubusercontent.com/u/1623393?v=3","gravatar_id":"","url":"https://api.github.com/users/mariuszs","html_url":"https://github.com/mariuszs","followers_url":"https://api.github.com/users/mariuszs/followers","following_url":"https://api.github.com/users/mariuszs/following{/other_user}","gists_url":"https://api.github.com/users/mariuszs/gists{/gist_id}","starred_url":"https://api.github.com/users/mariuszs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariuszs/subscriptions","organizations_url":"https://api.github.com/users/mariuszs/orgs","repos_url":"https://api.github.com/users/mariuszs/repos","events_url":"https://api.github.com/users/mariuszs/events{/privacy}","received_events_url":"https://api.github.com/users/mariuszs/received_events","type":"User","site_admin":false},"created_at":"2015-10-02T18:46:47Z","updated_at":"2015-10-02T18:46:47Z","body":"In curent version stub look like this:\r\n\r\n```\r\n{\r\n  \"request\" : {\r\n    \"url\" : \"/partners\",\r\n    \"method\" : \"POST\",\r\n    \"bodyPatterns\" : [ {\r\n      \"matchesJsonPath\" : \"$.payment_methods[?(@ == 'BANK')]\"\r\n    }, {\r\n      \"matchesJsonPath\" : \"$[?(@.superuser_email =~ /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\\\.[a-zA-Z]{2,4}/)]\"\r\n    } ],\r\n    \"headers\" : {\r\n      \"Content-Type\" : {\r\n        \"equalTo\" : \"application/json\"\r\n      }\r\n    }\r\n  },\r\n  \"response\" : {\r\n    \"status\" : 201,\r\n    \"headers\" : {\r\n      \"Location\" : \"http://localhost/partners/1000\"\r\n    }\r\n  },\r\n  \"priority\" : 2\r\n}\r\n```"}}