sile / jsone

Erlang JSON library
MIT License
291 stars 72 forks source link

Fix json_term clash with proplist object representation #17

Closed pichi closed 8 years ago

pichi commented 8 years ago

It is alternative and I think proper way to fix issue with #16

This feature is 13 days old and changes API without major version change. In normal SW cycle ti would be considered experimental feature anyway. I hope it has not gained a lot of users yet. I think proper fix is better than half fix. But it should be done fast.

This example shows the difference:

<<"{\"json\":\"[1,2,3]\"}">> = jsone:encode([{json, <<"[1,2,3]">>}]).
<<"[[1,2,3]]">> = jsone:encode([{{json, <<"[1,2,3]">>}}]).

I'm very sorry for all the fuss but I didn't think it thru enough.

pichi commented 8 years ago

I could add backward compatible implementation which would accept {json, _} variant but only {{json, _}} will be documented and {json, _} will lead to a warning message about {json, _} is obsolete.

sile commented 8 years ago

proper fix is better than half fix

I agree with your opinion. Thanks for your advice and the PR.

I could add backward compatible implementation

The feature is very recently added, so I expect that perhaps there are no people who (seriously) need backward compatibility yet.

pichi commented 8 years ago

I will warn early adopters what I know about.