<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki-ext.aps.anl.gov/epics/index.php?action=history&amp;feed=atom&amp;title=JSON_Field_Values</id>
	<title>JSON Field Values - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki-ext.aps.anl.gov/epics/index.php?action=history&amp;feed=atom&amp;title=JSON_Field_Values"/>
	<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=JSON_Field_Values&amp;action=history"/>
	<updated>2026-06-04T00:57:21Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.36.1</generator>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=JSON_Field_Values&amp;diff=3815&amp;oldid=prev</id>
		<title>AndrewJohnson: Add const arrays</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=JSON_Field_Values&amp;diff=3815&amp;oldid=prev"/>
		<updated>2016-06-01T21:06:47Z</updated>

		<summary type="html">&lt;p&gt;Add const arrays&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 21:06, 1 June 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot;&gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      })&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      })&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      field(INPI, {ca:&amp;quot;$(IOC):dblink MS&amp;quot;})&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      field(INPI, {ca:&amp;quot;$(IOC):dblink MS&amp;quot;})&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;     # These are constant arrays&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;     field(INPJ, [1, 2, 3, 4, 5])&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;     field(INPK, [&quot;Constant strings should also be possible&quot;]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;   &lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      # This is a JSON-formatted info-tag&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;      # This is a JSON-formatted info-tag&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>AndrewJohnson</name></author>
	</entry>
	<entry>
		<id>https://wiki-ext.aps.anl.gov/epics/index.php?title=JSON_Field_Values&amp;diff=3814&amp;oldid=prev</id>
		<title>AndrewJohnson: First pass</title>
		<link rel="alternate" type="text/html" href="https://wiki-ext.aps.anl.gov/epics/index.php?title=JSON_Field_Values&amp;diff=3814&amp;oldid=prev"/>
		<updated>2016-06-01T20:52:01Z</updated>

		<summary type="html">&lt;p&gt;First pass&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== JSON Field Values ==&lt;br /&gt;
&lt;br /&gt;
The current state of my Link Support development includes changes to the parsing of record instance data in database (.db) files.&lt;br /&gt;
&lt;br /&gt;
At present the code adds the ability to parse simplified JSON in specific places in the .db file, and converts that to proper JSON stored in a string for later parts of the IOC parsing process. The places where I see JSON as being accepted are in record field values, and in info tag values. Some examples of JSON link addresses are shown below, although the specific syntax supported by the link types has not been decided yet so these are just illustrations of what might be possible. Note that currently only link fields would be expected to accept JSON objects, although the code shouldn't prevent additional support being added later for other field types if desired.&lt;br /&gt;
&lt;br /&gt;
This modification does change the set of characters allowed in a bare-word string used as a field or info-tag value; the characters &amp;lt;code&amp;gt;:&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;;&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;&amp;amp;lt;&amp;amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;[]&amp;lt;/code&amp;gt; can no longer be used without enclosing the string inside double-quotes.&lt;br /&gt;
&lt;br /&gt;
 record(aSub, &amp;quot;$(IOC):sub1&amp;quot;) {&lt;br /&gt;
     # These are all database links&lt;br /&gt;
     field(INPA, &amp;quot;$(IOC):dblink MS&amp;quot;)&lt;br /&gt;
     field(INPB, {db:&amp;quot;$(IOC):dblink MS&amp;quot;})&lt;br /&gt;
     field(INPC, {db:[&amp;quot;$(IOC):dblink&amp;quot;, MS]})&lt;br /&gt;
     field(INPD, { # Comments are allowed inside JSON&lt;br /&gt;
         db: {&lt;br /&gt;
             pv:&amp;quot;$(IOC):dblink&amp;quot;,&lt;br /&gt;
             MS:true&lt;br /&gt;
         }&lt;br /&gt;
     })&lt;br /&gt;
 &lt;br /&gt;
     # These are channel access links&lt;br /&gt;
     field(INPE, &amp;quot;remote:calink.{\&amp;quot;ts\&amp;quot;:{}} CP&amp;quot;)&lt;br /&gt;
     field(INPF, {ca:[&amp;quot;remote:calink.{\&amp;quot;ts\&amp;quot;:{}}&amp;quot;, CP]})&lt;br /&gt;
     field(INPG, {ca:[&amp;quot;remote:calink&amp;quot;, {ts:{}}, CP]})&lt;br /&gt;
     field(INPH, {&lt;br /&gt;
         ca: {&lt;br /&gt;
             pv:&amp;quot;remote:calink&amp;quot;,&lt;br /&gt;
             filter: {ts:{}},&lt;br /&gt;
             CP:true&lt;br /&gt;
         }&lt;br /&gt;
     })&lt;br /&gt;
     field(INPI, {ca:&amp;quot;$(IOC):dblink MS&amp;quot;})&lt;br /&gt;
 &lt;br /&gt;
     # This is a JSON-formatted info-tag&lt;br /&gt;
     info(autosave, {&lt;br /&gt;
         fields: [SCAN, DESC],&lt;br /&gt;
         pass0: [VAL],&lt;br /&gt;
     })&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
My rules for simplified JSON are that double-quotes are optional around any string (used as a key or a value) that only contains the characters &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt;-&amp;lt;code&amp;gt;z&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;-&amp;lt;code&amp;gt;Z&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;9&amp;lt;/code&amp;gt;-&amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;_&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;.&amp;lt;/code&amp;gt;. The JSON keywords &amp;lt;code&amp;gt;null&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; will not be recognized as strings, nor will numbers that match the JSON encoding rules. Since JSON numbers don't include Infinity or NaN they will be recognized as unquoted strings, but should be handled correctly by the later parsing code. The &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; character can also be used inside simplified JSON to introduce a comment that lasts until the end of the current line.&lt;/div&gt;</summary>
		<author><name>AndrewJohnson</name></author>
	</entry>
</feed>