It's not clear if this style is really necessary. Why not just use the indexed syntax in this case?
I guess it may be the authors intention to mirror form encoded submissions, that would send all of these values to the server.
I'd suggest raising the point on the issue tracker so that it at least gets sufficient design discussion.
https://github.com/darobin/formic/issues
<form enctype='application/json'> <input type='text' name='fruit' value='apple'> <input type='number' name='bottle-on-wall' value='1'> <input type='number' name='bottle-on-wall' value='2'> <input type='number' name='bottle-on-wall' value='3'> </form> { "fruit": ["apple"], "bottle-on-wall": ["1", "2", "3"] }
<form enctype='application/json'> <input type='text' name='fruit' value='apple' enc='string'> <input type='number' name='bottle-on-wall' value='1' enc='array/number'> <input type='number' name='bottle-on-wall' value='2' enc='array/number'> <input type='number' name='bottle-on-wall' value='3' enc='array/number'> </form> { "fruit": "apple", "bottle-on-wall": [1, 2, 3] }
It's not clear if this style is really necessary. Why not just use the indexed syntax in this case?
I guess it may be the authors intention to mirror form encoded submissions, that would send all of these values to the server.
I'd suggest raising the point on the issue tracker so that it at least gets sufficient design discussion.
https://github.com/darobin/formic/issues