{"action":"created","issue":{"url":"https://api.github.com/repos/eed3si9n/sjson-new/issues/32","repository_url":"https://api.github.com/repos/eed3si9n/sjson-new","labels_url":"https://api.github.com/repos/eed3si9n/sjson-new/issues/32/labels{/name}","comments_url":"https://api.github.com/repos/eed3si9n/sjson-new/issues/32/comments","events_url":"https://api.github.com/repos/eed3si9n/sjson-new/issues/32/events","html_url":"https://github.com/eed3si9n/sjson-new/issues/32","id":195594240,"number":32,"title":"Reconsider the highly fragile Builder","user":{"login":"dwijnand","id":344610,"avatar_url":"https://avatars.githubusercontent.com/u/344610?v=3","gravatar_id":"","url":"https://api.github.com/users/dwijnand","html_url":"https://github.com/dwijnand","followers_url":"https://api.github.com/users/dwijnand/followers","following_url":"https://api.github.com/users/dwijnand/following{/other_user}","gists_url":"https://api.github.com/users/dwijnand/gists{/gist_id}","starred_url":"https://api.github.com/users/dwijnand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwijnand/subscriptions","organizations_url":"https://api.github.com/users/dwijnand/orgs","repos_url":"https://api.github.com/users/dwijnand/repos","events_url":"https://api.github.com/users/dwijnand/events{/privacy}","received_events_url":"https://api.github.com/users/dwijnand/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-14T17:27:43Z","updated_at":"2016-12-14T17:36:03Z","closed_at":null,"body":"It's way too simple to create or compose JsonFormat instances that end up throwing runtime errors.\r\n\r\nHere's a sample when running sbt/sbt's \"actions/all\" scripted test:\r\n\r\n```\r\n[info] sjsonnew.SerializationException: Unexpected builder state: End\r\n[info]     at sjsonnew.package$.serializationError(package.scala:19)\r\n[info]     at sjsonnew.Builder.stateError(Builder.scala:184)\r\n[info]     at sjsonnew.Builder.beginArray(Builder.scala:66)\r\n[info]     at sbt.internal.util.HListFormat$$anon$2.write(HListFormat.scala:25)\r\n[info]     at sbt.internal.util.HListFormat$$anon$2.write(HListFormat.scala:23)\r\n[info]     at sbt.internal.util.HListFormat$$anon$2.write(HListFormat.scala:27)\r\n[info]     at sbt.internal.util.HListFormat$$anon$2.write(HListFormat.scala:23)\r\n[info]     at sjsonnew.SupportConverter$class.toJsonUnsafe(SupportConverter.scala:23)\r\n[info]     at sjsonnew.support.scalajson.unsafe.Converter$.toJsonUnsafe(Converter.scala:7)\r\n[info]     at sjsonnew.SupportConverter$$anonfun$toJson$1.apply(SupportConverter.scala:14)\r\n[info]     at scala.util.Try$.apply(Try.scala:192)\r\n[info]     at sjsonnew.SupportConverter$class.toJson(SupportConverter.scala:14)\r\n[info]     at sjsonnew.support.scalajson.unsafe.Converter$.toJson(Converter.scala:7)\r\n[info]     at sbt.internal.util.PlainOutput.write(Output.scala:15)\r\n[info]     at sbt.internal.util.FileBasedStore$$anonfun$write$1.apply(CacheStore.scala:39)\r\n[info]     at sbt.internal.util.FileBasedStore$$anonfun$write$1.apply(CacheStore.scala:39)\r\n[info]     at sbt.io.Using.apply(Using.scala:23)\r\n[info]     at sbt.internal.util.FileBasedStore.write(CacheStore.scala:39)\r\n[info]     at sbt.internal.util.Tracked$CacheHelp.save(Tracked.scala:58)\r\n[info]     at sbt.internal.util.Tracked$$anonfun$inputChanged$1.apply(Tracked.scala:52)\r\n[info]     at sbt.Classpaths$.cachedUpdate(Defaults.scala:1669)\r\n[info]     at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1519)\r\n[info]     at sbt.Classpaths$$anonfun$updateTask$1.apply(Defaults.scala:1471)\r\n```\r\n\r\nI've hit this a general problem in different manifestation over the last few weeks switching sbt's modules to sjson-new.\r\n\r\nI've never run into these kinds of runtime errors when defining custom JSON typeclass instances using play-json."},"comment":{"url":"https://api.github.com/repos/eed3si9n/sjson-new/issues/comments/267100258","html_url":"https://github.com/eed3si9n/sjson-new/issues/32#issuecomment-267100258","issue_url":"https://api.github.com/repos/eed3si9n/sjson-new/issues/32","id":267100258,"user":{"login":"dwijnand","id":344610,"avatar_url":"https://avatars.githubusercontent.com/u/344610?v=3","gravatar_id":"","url":"https://api.github.com/users/dwijnand","html_url":"https://github.com/dwijnand","followers_url":"https://api.github.com/users/dwijnand/followers","following_url":"https://api.github.com/users/dwijnand/following{/other_user}","gists_url":"https://api.github.com/users/dwijnand/gists{/gist_id}","starred_url":"https://api.github.com/users/dwijnand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwijnand/subscriptions","organizations_url":"https://api.github.com/users/dwijnand/orgs","repos_url":"https://api.github.com/users/dwijnand/repos","events_url":"https://api.github.com/users/dwijnand/events{/privacy}","received_events_url":"https://api.github.com/users/dwijnand/received_events","type":"User","site_admin":false},"created_at":"2016-12-14T17:36:03Z","updated_at":"2016-12-14T17:36:03Z","body":"Defining how a type is serialising to JSON should be as simple as https://www.playframework.com/documentation/2.5.x/ScalaJson#Using-Writes-converters"}}
{"actor":{"display_login":"dwijnand"}}