spray / spray-json

A lightweight, clean and simple JSON implementation in Scala
Apache License 2.0
972 stars 190 forks source link

Correct Example In Providing JsonFormats for other Types #255

Closed shankarshastri closed 6 years ago

shankarshastri commented 6 years ago

Correct Example In Providing JsonFormats for other Types. @sirthias @jrudolph @ktoso

ktoso commented 6 years ago

It is on purpose not a case class to show how to deal with not-case-class es

ktoso commented 6 years ago

As it states just above there: Of course you can also supply (de)serialization logic for types that aren't case classes.

ktoso commented 6 years ago

Thanks for the PR but the change is not an improvement, sorry

shankarshastri commented 6 years ago

@ktoso , But then this should be val json = Color("CadetBlue", 95, 158, 160).toJson => val json = new Color("CadetBlue", 95, 158, 160).toJson ?

ktoso commented 6 years ago

Ah yes :) Please change that line instead :) thanks!

shankarshastri commented 6 years ago

Done @ktoso. Thanks 😄

ktoso commented 6 years ago

Thanks!