In an effort to redeem myself after making that totally idiotic statement in my prior post, I have updated Magritte-Json and Magritte-Tests-Json to make the additional test pass. Unfortunately I had to define kind: on the descriptions to get it to work. I really do not see any other way.<div>
I also added another (failing) test for adding Other Addresses to the JSON string.</div><div><br></div><div>Hope this helps.</div><div>John<br><br><div class="gmail_quote">On Thu, Jun 21, 2012 at 5:40 AM, Tomas Kukol <span dir="ltr">&lt;<a href="mailto:tomas.kukol@gmail.com" target="_blank">tomas.kukol@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I am using Margitte-Json and Magritte-Tests-Json. MJTestPerson and<br>
MJTestAddress are part of Magritte-Tests-Json package and these<br>
classes have both magritte descriptions. There are codes for both<br>
classes:<br>
<br><div class="HOEnZb"><div class="h5"><br>
<br>
On Wed, Jun 20, 2012 at 5:02 PM, Philippe Marschall<br>
&lt;<a href="mailto:philippe.marschall@gmail.com">philippe.marschall@gmail.com</a>&gt; wrote:<br>
&gt; On Wed, Jun 20, 2012 at 2:23 PM, Tomas Kukol &lt;<a href="mailto:tomas.kukol@gmail.com">tomas.kukol@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Hello,<br>
&gt;&gt;<br>
&gt;&gt; I have created a test for #fromJson: message.<br>
&gt;&gt;<br>
&gt;&gt; MJTestFromJson &gt;&gt; testFromJsonWithAddress<br>
&gt;&gt;       | person address |<br>
&gt;&gt;       person := MJTestPerson fromJson:<br>
&gt;&gt; &#39;{&quot;Name&quot;:&quot;Tomas&quot;,&quot;Address&quot;:{&quot;PostalCode&quot;:&quot;19800&quot;,&quot;City&quot;:&quot;Prague&quot;}}&#39;.<br>
&gt;&gt;<br>
&gt;&gt;       self assert: person name equals:  &#39;Tomas&#39;.<br>
&gt;&gt;       address := person address.<br>
&gt;&gt;       self assert: address isNil not.<br>
&gt;&gt;       self assert: address postalCode equals: &#39;19800&#39;.<br>
&gt;&gt;       self assert: address city equals: &#39;Prague&#39;.<br>
&gt;&gt;<br>
&gt;&gt; But the test fails because it cannot find PostalCode in MJTestPerson<br>
&gt;&gt; instace (should be probably in MJTestAddress). Is it a problem of my<br>
&gt;&gt; #fromJson: usage or wrong implementation of JSON deserialization?<br>
&gt;<br>
&gt; Are you using Magritte-JSON? If you can you show us the descriptions,<br>
&gt; ideally attach the whole MJTestPerson class?<br>
&gt;<br>
&gt; Cheers<br>
&gt; Philippe<br>
&gt; _______________________________________________<br>
&gt; seaside mailing list<br>
&gt; <a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
&gt; <a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
</div></div></blockquote></div><br></div>