<div dir="ltr"><div dir="ltr">On Sun, Jun 16, 2024 at 5:33 PM Mariano Montone via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><u></u>

  
    
  
  <div>
    <p>El 16/6/24 a las 18:52, Mark Volkmann
      via Cuis-dev escribió:<br></p>
    <blockquote type="cite">
      
      <div dir="ltr">There are methods to encode and decode JSON in the
        WebClient package inside the WebUtils class. But they seem
        incomplete and/or broken.<span> </span>For example, the
        class method `#jsonObj:on:` does not handle arbitrary objects by
        using reflection to discover their instance properties. That's a
        feature I want. I suppose I can implement that myself, but this
        seems like something someone most likely already implemented. Is
        there another package for JSON that is recommended?</div>
    </blockquote>
    <p>Yes.</p>
    <p>Feature require: 'JSON'.</p></div></blockquote><div><br></div><div>After running that in a Workspace I entered this where <font face="monospace">dog</font> is variable that holds an object from my <font face="monospace">Dog</font> class that has the instance variables <font face="monospace">id</font>, <font face="monospace">name</font>, and <font face="monospace">breed</font>:</div><div><br></div><div><font face="monospace">s := Json render: dog</font></div><div><br></div><div>That gives me MessageNotUnderstood: VDog>>jsonWriteOn:.</div><div><br></div><div>Why does it expect me to implement that method in my <font face="monospace">Dog</font> class? I expect it to just use reflection to get all the instance variables of the object and build JSON from them.</div><div><br></div><div>I really wish it was more common for Smalltalk packages to provide documentation on their usage and some example code.</div><div><br></div></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div>