#540 Marker Tag format in JSON when not used

Greg Ingram Sat 23 Sep 2017

How would you represent a Marker Tag in JSON format when not used?

Use the Zinc Formats Operation (http://project-haystack.org/doc/Ops) for example. The Receive property in the first row is not used, so it is blank.

ver:"3.0"
mime,receive,send
"text/csv",,M
"text/plain",M,M
"text/zinc",M,M

I understand it would be "m:" for JSON if used. but how would you represent when not used?

A "" would be confusing as you could mistake for empty String Tag when parsing and null would be confused for a Null Tag. I don't think JSON allows for a blank.

It seems like a scenario like this, the Receive and Send properties would be a Boolean Tag so it could be true or false.

Thanks in advance.

Brian Frank Sun 24 Sep 2017

You omit the name value pair in the row (or you can use null):

{"meta": {"ver":"3.0"}, 
 "cols":[ {"name":"name"}, {"name":"mime"}, 
          {"name":"receive"}, {"name":"send"} ], 
 "rows":[ 
   {"name":"zinc", "mime":"text/plain", "receive":"m:", "send":"m:"}, 
   {"name":"csv", "mime":"text/csv", "send":"m:"} 
 ] }

Greg Ingram Sun 24 Sep 2017

Thanks Brian, I will review and update my code.

I have another question based on your example. It appears you added a column for "name". This is not shown as a property/column in the Formats section in documentation. Which one is correct? To include "name" or not include?

Thanks again for the help.

Brian Frank Mon 25 Sep 2017

You don't need name - I just copied that from our software and we add a few more columns

Login or Signup to reply.