kifi / json-annotation Goto Github PK
View Code? Open in Web Editor NEWThe quickest way to add a JSON format to your Play project's case classes
License: MIT License
The quickest way to add a JSON format to your Play project's case classes
License: MIT License
I have a case class with a tuple in it which play's macro can't handle. I wrote a quick implicit Writes def but there's no way to use it with your annotation. Perhaps you could import ClassName._ so we can put them in the companion object?
I noticed that the @json
annotation doesn't work on my private case class
. Seems like your case class check is a bit too strict.
It'd be great if this worked with the latest Scala 2.12 / Play 2.6 with a published version.
This is the magic incantation for Scala 2.11.6:
addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0-M5" cross CrossVersion.full)
The docs will be even more out of date when Macro Paradise becomes available for Scala 2.11.7
scalamacros/paradise#71
import com.kifi.macros.json
@json case class Person(name: String, children: Option[Set[Person]])
I wish the library detects recursive types and uses Play's lazyFormat
macro...
Hi,
I'm giving a try to your json-annotation in an existing play-slick project.
When I add the @JSON annotation I'm having the following error in my sclik table definition :
[error] value tupled is not a member of object models.Cpaid
[error] def * = (cpaid , custid )<>(Cpaid.tupled, Cpaid.unapply _)
Do I miss something?
I checked here: https://oss.sonatype.org/content/repositories/releases/com/kifi/
See: https://travis-ci.org/pathikrit/metarest/builds/50177041
Can you deploy? I am writing a library that depends on your library and needs it to work across 2.10.x and 2.11.x
https://github.com/pathikrit/metarest
We would love to use your plugin at Gravity, but unfortunately it would require a difficult migration for certain single-value case classes that use the standard Play format (e.g. {"name":"Bob"}
for case class Person(name: String)
). The problem is that we have many such classes and serializations being stored and transmitted among many apps; to use your plugin as-is we would have to perform a difficult migration involving hundreds of servers.
Would it be possible for you to release a patch to support "backwards compatibility" with the default Play format for single-value case classes? If not, I suppose I could do my best to submit a PR with one, but chances are you'll be able to whip that out much more quickly as I have no macro experience...
When other class annotations (such as @serialversionuid) are required, the macro can't work: "Annotation is only supported on case class"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.