Actually I started wiriting one MooseX::Embody::JSON and MooseX::Embody::JSON::Role

This allows me to do things exactly I would expect it:

package WebService::DreamWidth::Entry; use Moose; use MooseX::Embody::JSON; use WebService::DreamWidth::Icon; use WebService::DreamWidth::Poster; # this one is not part of Embody::Json yet has "tags" => (is=>'ro', isa => 'ArrayRef[Str]'); j_obj "icon" =>(class => "WebService::DreamWidth::Icon", is =>'ro'); j_obj "poster" =>(class => "WebService::DreamWidth::Poster", is =>'ro' +); j_attr "security" => (is => 'ro'); j_attr "body_html"=> (is => 'ro'); j_attr "subject_raw"=> (is => 'ro'); j_attr "subject_html"=> (is => 'ro'); j_attr "allowmask"=> (is => 'ro'); j_attr "body_raw"=> (is => 'ro'); j_attr "icon_keyword"=> (is => 'ro'); j_attr "entry_id"=> (is => 'ro'); j_attr "datetime"=> (is => 'ro'); j_attr "url" => (is => 'ro');

This is early prototype, I need to play with it a lot, before releasing in even as beta, and some internals may be needs changing a log, but is is exactly the thing I think is needed for creating JSON-based REST clients.

And yes, comments and suggestion are appreciated.


In reply to Re: Framework for making Moose-compatible object from json by nataraj
in thread Framework for making Moose-compatible object from json by nataraj

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.