boonproject / boon

Simple opinionated Java for the novice to expert level Java Programmer. Low Ceremony. High Productivity.
http://richardhightower.github.io/site/Boon/Welcome.html
Apache License 2.0
522 stars 102 forks source link

char[] encoded as array rather than as a quoted string #293

Closed 0xg0nz0 closed 9 years ago

0xg0nz0 commented 9 years ago

The API has CharBuf.addQuoted(char[]) so you can work around this with a custom wrapper type and a custom serializer, but it would be better for the serializer to recognize that char[] is an acceptable string representation; ['T','e','s','t'] does not seem like a reasonable default.

RichardHightower commented 9 years ago

I actually thought about this one once. And at the time.. it seemed like if you were passing an array that you were telling Boon.. hey... here is an array... and you wanted it to come out as a JSON array.

array -> array... seemed like the natural order of things to me.

But I will think about it again. I have more buggy bugs to work on for boon, and this seems like more of a preference. Do you know how GSON and/or Jackson would handle this?

I think I picked the right default, but hell.. I could be wrong.. What did they do?