This is the desired output
{"node":{"type":"community","field_incentives":{"und":[{"value":"fun"},{"value":"nice"}]},"field_email":{"und":[{"value":"
[email protected]"}]}}}
Here's my code.
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
JsonFactory f = new JsonFactory();
JsonGenerator g = f.createJsonGenerator(outputStream);
g.writeStartObject();
g.writeObjectFieldStart("node");
g.writeStringField("type", "community");
g.writeObjectFieldStart("field_incentives");
g.writeFieldName("und");
g.writeStartArray();
???I don't know how to make [{"value":"fun"},{"value":"nice"}]
g.writeEndArray();
g.writeObjectFieldStart("field_email");
g.writeFieldName("und");
g.writeStartArray();
???
g.writeEndArray();
g.writeEndObject();
g.close();
Here's the output
{"node":{"type":"community","title","field_incentives":{"und":[],"field_email":{"und":[]}}}}
Thanks