Open He-Pin opened 7 years ago
The root cause is I am using a Recursive Types
and auto mapping, so boom!
The automapping gave me a Writes
, but with the recursived one as null
.
easy fixed with a lazy
.
Writes
is null,throw an exception. lazy val
s will give a SOF
, eg:
java.lang.StackOverflowError
at scala.collection.SeqLike.$colon$plus$(SeqLike.scala:559)
at scala.collection.AbstractSeq.$colon$plus(Seq.scala:41)
at play.api.libs.json.JsPath.$bslash(JsPath.scala:186)
at services.schema.FieldDescription$.writes$lzycompute(SchemaManager.scala:234)
at services.schema.FieldDescription$.writes(SchemaManager.scala:234)
at services.schema.TypeDescription$.writes$lzycompute(SchemaManager.scala:198)
at services.schema.TypeDescription$.writes(SchemaManager.scala:198)
Hi @hepin1989, the macro could check for direct reference to the same type (which anyway lead to issue in Scala), on the other side indirect reference using Option
or Traversable
could be supported.