bizzabo / play-json-extensions

+22 field case class formatter and more for play-json
http://cvogt.org/play-json-extensions/api/
Other
196 stars 44 forks source link

Make formatCaseClass return an OFormat #35

Closed clamothe closed 7 years ago

clamothe commented 7 years ago
trait Format[A] extends Writes[A] with Reads[A]
trait OFormat[A] extends OWrites[A] with Reads[A] with Format[A]

trait OWrites[-A] extends Writes[A] {
  def writes(o: A): JsObject
  ...
}

formatCaseClass currently creates a Format with a writes method that always returns a JsObject. By switching Format to OFormat here, callers of this method have a type-safe guarantee that it's write method returns a JsObject.

At a cursory glance, I didn't identify any other formatters that always write JsObjects.

For more info on OFormat vs Format, this is helpful: https://stackoverflow.com/a/32290351

cvogt commented 7 years ago

@clamothe I suggest you add the email address you used in your commit to your github account, so commits are linked properly

clamothe commented 7 years ago

Done

cvogt commented 7 years ago

thx :)!! I am working through a little issue with the github support adding a CLA here (just saying I agree to Apache 2.0 licensing), as I was advised to do by someone who knows FOSS better than I do. But then I'll get 0.9.0 out.

clamothe commented 7 years ago

Great, thank you. Have you had a chance to look at PR #36 as well?

cvogt commented 7 years ago

update: still waiting to resolve the issue: https://github.com/cla-assistant/cla-assistant/issues/130

hopefully soon

CLAassistant commented 7 years ago

CLA assistant check
All committers have signed the CLA.

cvogt commented 7 years ago

@clamothe ok, finally figured that out. You mind signing the CLA (it just say you agree with Apache 2.0), by clicking on https://cla-assistant.io/xdotai/play-json-extensions?pullRequest=35 ?

clamothe commented 7 years ago

Done

clamothe commented 7 years ago

I'm eager to use this feature as well as #36. If both seem like appropriate additions, let me know if you need anything else from my end to make it happen. Thanks @cvogt

cvogt commented 7 years ago

will publish tomorrow. merged everything

clamothe commented 7 years ago

Thank you!

On Thu, Jun 29, 2017 at 4:09 PM, Jan Christopher Vogt < notifications@github.com> wrote:

will publish tomorrow. merged everything

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/xdotai/play-json-extensions/pull/35#issuecomment-312132213, or mute the thread https://github.com/notifications/unsubscribe-auth/AACTYkI5F334jslZAiA0QEw1zGOA9Yijks5sJC62gaJpZM4Nuyt7 .

cvogt commented 7 years ago

released 2.11 to sonatype a few hours ago, will take up to a day to arrive in maven central

clamothe commented 7 years ago

Thank you