javajsonvraptor

A field of type "String" does not appear in the result (json) serialization of the vraptor controller


A field of type "String" does not appear in the result of the serialization controller

result.use(Results.json()).indented().from(list).serialize();

Some fields appear, and another not appear when null, the field I want is to type "String" and implemented the "get" and "sets" and this always filled

PS: I am using vraptor framework


Solution

  • I solved using the "include":

    result.use(Results.json()).indented().from(list)
                    .include("codigoComposto").serialize();