- From: Christophe Grand <christophe@cgrand.net>
- Date: Fri, 28 Nov 2014 10:44:54 +0100
- To: public-html@w3.org
Received on Friday, 28 November 2014 10:50:36 UTC
It seems to me that the encoding algorithm
http://www.w3.org/TR/html-json-forms/#the-application-json-encoding-algorithm
depends on the ordering of inputs:
<form enctype='application/json'>
<input name='foo' value='one'>
<input name='foo' value='two'>
<input name='foo[x]' value='three'>
</form>
{"foo": {"1": one", "2": "two", "x": "three"}}
<form enctype='application/json'>
<input name='foo[x]' value='three'>
<input name='foo' value='one'>
<input name='foo' value='two'>
</form>
{"foo": {"": ["one", "two"], "x": "three"}
Sorting inputs before encoding them would make the algorithm simpler and
clearly independent of the actual ordering.
Christophe
--
On Clojure http://clj-me.cgrand.net/
Clojure Programming http://clojurebook.com
Training, Consulting & Contracting http://lambdanext.eu/
Received on Friday, 28 November 2014 10:50:36 UTC