Closed gaydenko closed 10 years ago
yeah Map[String,Any] I don't know how to do yet. That would require runtime reflection I think.
Not sure it is for the next issue, so asking here :)
In fact, I have tried Map
and Seq
as far as not found hash-like and array-like case classes in muster.ast
(lets omit case classes for now). These containers are needed to craft arbitrary tree. Have I missed something?
I can clarify the intention. There are (far to be rare) use cases a resultant map is dynamic, i.e. a list of Tuple2
(as a base of the map) is creating at runtime. And the aim is to serialize such maps. At this case a model can not be modeled as a case class.
o they exist: https://github.com/json4s/muster/blob/master/core/src/main/scala/muster/ast/ast.scala#L398-L400
But they are kind of deferred to each implementation so that for arrays for example it doesn't read the entire array but just the element it's trying to deserialize at that moment.
For jawn their implementation is this: https://github.com/json4s/muster/blob/master/codecs/jawn/src/main/scala/muster/codec/jawn/jawn_input.scala#L12-L69
Yes, I have found those abstract classes. But they are abstract, and those jawn implementations your are pointing to are private. How to become happy? :)
Your use case is dynamic json generation right? Why not build a jawn ast and then get muster to serialize it?
Yes, it is one of the use cases. Thanks for the tip. I'm new in these areas and need more minutes to try it.
Heh... Still hasn't found a way muster can serialize an AstNode[_]
...
O I'm terribly sorry I haven't implemented an integration with the jawn ast integration. there is integration with the json4s ast, play-json ast and argonaut ast. it's missing an implementation like this one: https://github.com/json4s/muster/blob/master/codecs/json4s/src/main/scala/muster/codec/json4s/package.scala
Aha! Thanks for the clarification! Now I see I have tried to look for a black cat in a black room while there isn't a cat at all there :) But I can't implement it myself yet..
Hi! I'd want to serialize this mess:
I have tried
but have got: