How can i exclude avro namespace when converting to json
<p>Recently i am writing the mapper for pushing data to elasticsearch.
My input is avro object where i am trying to convert to Json. Every thing is fine but i am getting namespace in json, where elasticsearch wont allow namespace as key objects.</p>

<pre><code>"requestobj":{"com.nw.data.Request":{"event_id":null,"event_epoch":-1,"event_dispatch_epoch":-1,"server_epoch":1471852915279,"date":{"string":"2016-08-22"},"time":{"string":"08:01:55"},"req_source":{"string":"app"},"req_channel":{"string":"Mobile"},"req_dimension":{"string":"1312x704"}
</code></pre>

<p>is there a way to exclude namespace - <strong>com.nw.data.Request</strong></p>

<p>I am using following code to convert avro to json:</p>

<pre><code>public static String getJsonString(GenericRecord record) throws IOException {
        ByteArrayOutputStream os = new ByteArrayOutputStream();
        JsonEncoder encoder = EncoderFactory.get().jsonEncoder(record.getSchema(), os);
        DatumWriter&lt;GenericRecord&gt; writer = new GenericDatumWriter&lt;GenericRecord&gt;(record.getSchema());
        writer.setSchema(record.getSchema());
        writer.write(record, encoder);
        encoder.flush();
        String jsonString = new String(os.toByteArray(), Charset.forName("UTF-8"));
        os.close();

        return jsonString;
    }
</code></pre>