json-view icon indicating copy to clipboard operation
json-view copied to clipboard

[Feature Request]: Support to rename fields

Open thomasguo opened this issue 7 years ago • 2 comments

Hi,

It is common that sometimes output json format requires different field names from POJO fields. So I think it would be nice if developers could rename field name(s) when serializing POJO to json.

Thanks for your great work!

thomasguo avatar Jun 16 '17 12:06 thomasguo

What would that look like? Just an option like .rename(field, name) or did you have something else in mind?

monitorjbl avatar Jun 16 '17 13:06 monitorjbl

Yes, that option looks good. Maybe something like .rename(field1, name1, field2, name2 ...) , which could specify multiple renamed fields.

thomasguo avatar Jun 16 '17 14:06 thomasguo