horizonzy opened a new pull request, #2581: URL: https://github.com/apache/avro/pull/2581
In some cases, we hope that the reflect fields order maintain the original order. ``` class Pojo { String f2; String f1; } ``` At client, it create Pojo and serialize it using JSON format. The json: ``` {"f2":"a", "f1":"b"} ``` And then, create the schema using refelct data, the fields will be ordered. The schema: ``` [{"name":"f1", "type":"string"}, {"name":"f2", "type":"string"}] ``` Then push the payload and schema to server, the server store the json payload as k,v format, and store the schema to the schema registry. At another client, it want to read the data. Then the server read the k,v format data, then decode it according the schema from schema registry. But the fields order is not match the origin. So the decode json will be like ``` {"f1":"b", "f2":"a"} ``` I want to make the json fields order maintain the original order, when creating the schema using ReflectData, not order the fields. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@avro.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org