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"><<a href="mailto:tomas.kukol@gmail.com" target="_blank">tomas.kukol@gmail.com</a>></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>
<<a href="mailto:philippe.marschall@gmail.com">philippe.marschall@gmail.com</a>> wrote:<br>
> On Wed, Jun 20, 2012 at 2:23 PM, Tomas Kukol <<a href="mailto:tomas.kukol@gmail.com">tomas.kukol@gmail.com</a>> wrote:<br>
>> Hello,<br>
>><br>
>> I have created a test for #fromJson: message.<br>
>><br>
>> MJTestFromJson >> testFromJsonWithAddress<br>
>> | person address |<br>
>> person := MJTestPerson fromJson:<br>
>> '{"Name":"Tomas","Address":{"PostalCode":"19800","City":"Prague"}}'.<br>
>><br>
>> self assert: person name equals: 'Tomas'.<br>
>> address := person address.<br>
>> self assert: address isNil not.<br>
>> self assert: address postalCode equals: '19800'.<br>
>> self assert: address city equals: 'Prague'.<br>
>><br>
>> But the test fails because it cannot find PostalCode in MJTestPerson<br>
>> instace (should be probably in MJTestAddress). Is it a problem of my<br>
>> #fromJson: usage or wrong implementation of JSON deserialization?<br>
><br>
> Are you using Magritte-JSON? If you can you show us the descriptions,<br>
> ideally attach the whole MJTestPerson class?<br>
><br>
> Cheers<br>
> Philippe<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>
_______________________________________________<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>