It is valid in Javascript.
You might get confused at first trying to test this:
JSON.parse("bob");
This would fail with the error: "Unexpected token b". However, that's the equivalent of passing just plain bob
as the text in the response, not "bob"
. If you add the quotes:
JSON.parse('"bob"')
You get the simple string "bob" back as you should.