What would be the best way to work with complex objects, prevent collision and make them easy to parse.
?watermark={text:"I am the copy",position:[0,0]}&overlay={image:"overlay.jpg",position:[50,50]}
or
?watermark="I am the copy"&watermark.position=0,0&overlay=overlay.jpg&overlay.position:50,50
Advantages of the first approach. Easy to parse using a json parser. e.g Json.NET No chance of collision
Disadvantages of the first approach. Verbose.
Advantages of the second approach. Easy enough to filter via regex.
e.g (overlay=|overlay.\w+=)[^&]+
No chance of collision
Disadvantages of the second approach. Requires individual parsing of matched properties though you could possibly use Json.NET for that also.
Thoughts??
As a consumer of the resizer, I would prefer the second version. I think I would go with dashes though. Seems more query string ish to me.
That is much easier to type and edit by hand for people not generating url's from code. If you attempt to write a json parameter by hand, you will be more likely to make syntax errors, forgetting a " or a } or a ].
The above query string scheme will seem familiar to devs used to working with css.