{"action":"closed","issue":{"url":"https://api.github.com/repos/KarelCemus/play-json/issues/56","repository_url":"https://api.github.com/repos/KarelCemus/play-json","labels_url":"https://api.github.com/repos/KarelCemus/play-json/issues/56/labels{/name}","comments_url":"https://api.github.com/repos/KarelCemus/play-json/issues/56/comments","events_url":"https://api.github.com/repos/KarelCemus/play-json/issues/56/events","html_url":"https://github.com/KarelCemus/play-json/issues/56","id":152545618,"number":56,"title":"Lazily evaluate @when fields","user":{"login":"KarelCemus","id":1996368,"avatar_url":"https://avatars.githubusercontent.com/u/1996368?v=3","gravatar_id":"","url":"https://api.github.com/users/KarelCemus","html_url":"https://github.com/KarelCemus","followers_url":"https://api.github.com/users/KarelCemus/followers","following_url":"https://api.github.com/users/KarelCemus/following{/other_user}","gists_url":"https://api.github.com/users/KarelCemus/gists{/gist_id}","starred_url":"https://api.github.com/users/KarelCemus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KarelCemus/subscriptions","organizations_url":"https://api.github.com/users/KarelCemus/orgs","repos_url":"https://api.github.com/users/KarelCemus/repos","events_url":"https://api.github.com/users/KarelCemus/events{/privacy}","received_events_url":"https://api.github.com/users/KarelCemus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/KarelCemus/play-json/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-05-02T12:43:50Z","updated_at":"2016-09-12T11:05:52Z","closed_at":"2016-09-12T11:05:52Z","body":"For example avoid extensive SQL queries @when false\r\n\r\n```scala\r\n\r\n    \"lazily evaluate values with @when restriction\" >> {\r\n          @protocol.out case class Foo( @json.io @json.when( _.render ) value: String ) {\r\n            @json.out @json.when( _.render )\r\n            def throwing: String = throw new IllegalStateException( \"This should be never invoked\" )\r\n          }\r\n          \"when false\" in {\r\n            implicit val context = Context( requestId = 1, render = false )\r\n            new Foo( \"some value\" ).json mustEqual JsNull\r\n          }\r\n        }\r\n```\r\n\r\nThis fails"}}
{"actor":{"display_login":"KarelCemus"}}