github.com/slspeek/camlistore_namedsearch@v0.0.0-20140519202248-ed6f70f7721a/doc/schema/blob-magic.txt (about)

     1  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
     2  Camli Blob Magic
     3  -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
     4  
     5  [Note: not totally happy with this yet...]
     6  
     7  Ideal Camli JSON blobs should begin with the following 15 bytes:
     8  
     9          {"camliVersion"
    10  
    11  However, it's acknowledged that some JSON serialization libraries will
    12  format things differently, so additional whitespace should be
    13  tolerated.
    14  
    15  An ideal camli serializer will strive for the above header, though, by
    16  doing something like:
    17  
    18        -- removing the "camliVersion" from the object, noting its value
    19           (and requiring it to be present)
    20  
    21        -- serializing the JSON with an existing JSON serialization library,
    22  
    23        -- removing the serialized JSON's leading "{" character and prepending
    24           the 15 byte header above, as well as the colon and saved version
    25           and comma (which can have whitespace as desired)
    26