We've found out that bserverj is clever when working with JSON codes. When creatives are defined as HTML source, response looks like: ["<p>code one</p>", "<p>code two</p>", "etc."]. But when there is JSON, response is not ["{ \"ad\": \"structure one\" }", "<p>code two</p>"] as expected, but its [{ "ad": "structure one" }, "<p>code two</p>"] – which is fine! It's nice there is some JSON detection that optimizes away JS structure escaping. But there is an error when there are snippets. When there is snippet with code "foo" for type text/html, bserverj returns something like: [{ "ad": "structure one" }foo, "<p>code two</p>foo"] ... it just pastes that snippet at the end. Result is invalid JSON. We can maybe detect it and parse it away before parsing JSON, but we think it's an obvious error inside bserverj. Could you please acknowledge there is such a bug and maybe even fix it? There are few possible fixes: 1. Easiest one is to detect JSON creative after adding snippet, not before... and if the result after adding snippet is not valid JSON, treat it as HTML string (= make JS string). 2. Put snippets inside some JSON field, so there is something like { "ad": "structure", "_sassnippets": ["foo"] }. 3. When there is creative and some snippets, wrap them in another array, so the response is [[{ "ad": "structure one" }, "foo"], "<p>code two</p>foo"]. 4. Remove from bserverj all text/html snippets and invent some new way to define application/json snippet (maybe snippet can be JSON too and then you can merge). 5. Remove all snippets from bserverj. That would be unpleasant for us, since we are currently using snippets. Please don't consider doing this 🙂 Thank you.
... View more