{"action":"opened","issue":{"url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/issues/85","repository_url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract","labels_url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/issues/85/labels{/name}","comments_url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/issues/85/comments","events_url":"https://api.github.com/repos/spring-cloud/spring-cloud-contract/issues/85/events","html_url":"https://github.com/spring-cloud/spring-cloud-contract/issues/85","id":179172817,"number":85,"title":"Custom methods on server side for nested objects","user":{"login":"kkrawczy","id":11983728,"avatar_url":"https://avatars.githubusercontent.com/u/11983728?v=3","gravatar_id":"","url":"https://api.github.com/users/kkrawczy","html_url":"https://github.com/kkrawczy","followers_url":"https://api.github.com/users/kkrawczy/followers","following_url":"https://api.github.com/users/kkrawczy/following{/other_user}","gists_url":"https://api.github.com/users/kkrawczy/gists{/gist_id}","starred_url":"https://api.github.com/users/kkrawczy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kkrawczy/subscriptions","organizations_url":"https://api.github.com/users/kkrawczy/orgs","repos_url":"https://api.github.com/users/kkrawczy/repos","events_url":"https://api.github.com/users/kkrawczy/events{/privacy}","received_events_url":"https://api.github.com/users/kkrawczy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-26T08:55:56Z","updated_at":"2016-09-26T08:55:56Z","closed_at":null,"body":"It seems that that custom methods on the server side do not work when we use them to validate nested properties. \r\nTo make it clear, let's consider a piece of a contract from http-server-dsl project:\r\n`body([\r\n                fraudCheckStatus: \"OK\",\r\n                rejectionReason : $(consumer(null), producer(execute('assertThatRejectionReasonIsNull($it)')))\r\n])`\r\n\r\nAnd what if rejectionReason is an object with title, explanation, etc... and we want to check the title. If I change the contract to:\r\n`body([\r\n                fraudCheckStatus: \"OK\",\r\n                rejectionReason : [\r\n                        title: $(consumer(null), producer(execute('assertThatRejectionReasonIsNull($it)')))\r\n                ]\r\n])`\r\n\r\nthe assert for \"rejectionReason.title\" is not generated (which also means that tests are passing).\r\nBTW, I noticed this issue while working with spring-cloud-contract and with request objects that are a bit more complicated than the one in the example project.\r\nIs this a known issue? Or maybe I structure the contract in a bad way?"}}
{"actor":{"display_login":"kkrawczy"}}