[OPEN-ILS-DEV] ***SPAM*** Understanding the action / trigger / hook / reactor / validator architecture
Scott McKellar
mck9 at swbell.net
Tue Mar 23 23:15:50 EDT 2010
--- On Tue, 3/23/10, Joe Atzberger <jatzberger at esilibrary.com> wrote:
> I think it would be OK. Our JSON parser seems to tolerate comments,
> even though they are non-spec. Scott or Mike can probably correct me
> if I'm wrong here.
I can speak to the C code; don't know about perl.
In C we have several JSON parsers lying around, of which only one tolerates comments. It is called from osrf_json_gateway.c, which runs in the Apache environment. I don't know how it fits into the big picture.
One thing you may be able to get away with is including a comment as data associated with a key in a JSON object, e,g,:
{ "from":"au", "comment":"This is a comment" }
Whether that works depends on the semantics of the JSON you're building, and on how thoroughly the recipient enforces its expectations. I don't recommend this approach unless you're desperate.
Background: I have read that early drafts of the JSON standard allowed for comments. However those provisions were omitted from the final standard, on the ground that JSON is not intended for human consumption.
Early versions of OSRF allowed comments as an extension to JSON, and used them to convey class information. Since then we have adopted a different convention for encoding classes, but the old stuff has not been completely eliminated. I don't know if it ever will be.
Scott McKellar
More information about the Open-ils-dev
mailing list