Loading ...
Sorry, an error occurred while loading the content.

Feedback on non-standard json

Expand Messages
  • Jonathan Wallace
    I m redoing big parts of libjson and I m going to extend it to use non-standard json (as a compile option, not standard) and I m curious if anyone foresee any
    Message 1 of 4 , Aug 9, 2010
    View Source
    • 0 Attachment
      I'm redoing big parts of libjson and I'm going to extend it to use non-standard json (as a compile option, not standard) and I'm curious if anyone foresee any problems with what I'm thinking:

      {
      "binary" : <7>7 bytes,
      "binary array" : [
      <5>ABCDE,
      <2>AB,
      <3>ABC
      ],
      "name with : colon" : {
      "subitem" : 2
      },
      "reference to array" : &binary array:2&,
      "reference" : &name with \: colon:subitem&
      }

      In my time using json the only reasons I've ever had to used XML is when I need to use references or binary data, but I hate xmls complexity, so I want to extend libjson to be able to do that.

      Sent from my iPhone
    • Tatu Saloranta
      ... XML does not have native binary data either; usually base64 encoding is used, and same works well for JSON. Why not use that? Or given that content is just
      Message 2 of 4 , Aug 9, 2010
      View Source
      • 0 Attachment
        On Mon, Aug 9, 2010 at 6:02 PM, Jonathan Wallace <ninja9578@...> wrote:
        > I'm redoing big parts of libjson and I'm going to extend it to use non-standard json (as a compile option, not standard) and I'm curious if anyone foresee any problems with what I'm thinking:
        >
        > {
        >   "binary" : <7>7 bytes,
        >   "binary array" : [
        >      <5>ABCDE,
        >      <2>AB,
        >      <3>ABC
        >   ],
        >   "name with : colon" : {
        >      "subitem" : 2
        >   },
        >   "reference to array" : &binary array:2&,
        >   "reference" : &name with \: colon:subitem&
        > }
        >
        > In my time using json the only reasons I've ever had to used XML is when I need to use references or binary data, but I hate xmls complexity, so I want to extend libjson to be able to do that.

        XML does not have native binary data either; usually base64 encoding
        is used, and same works well for JSON. Why not use that? Or given that
        content is just Unicode there is nothing preventing you from just
        using regular text, limiting to codepoints 0 through 255.
        And references are typically these are done at layer above JSON, using
        naming conventions or schema (implicit or explicit) to indicate where
        a reference is expected. XML has no native notation for these either
        (unless perhaps general entity references). They are built using
        layers above.

        So I am not quite sure why you would want to break syntax-level
        compatibility to do things that can be done at layer(s) directly above
        JSON.

        -+ Tatu +-
      • Jonathan Wallace
        Thanks for your input. I guess I never looks at how my XML library handled the binary. I guess I ll just add a method to insert binary data that automatically
        Message 3 of 4 , Aug 10, 2010
        View Source
        • 0 Attachment
          Thanks for your input. I guess I never looks at how my XML library handled the binary. I guess I'll just add a method to insert binary data that automatically converts it to base64

          Sent from my iPhone

          On Aug 9, 2010, at 22:48, Tatu Saloranta <tsaloranta@...> wrote:

          > On Mon, Aug 9, 2010 at 6:02 PM, Jonathan Wallace <ninja9578@...> wrote:
          > > I'm redoing big parts of libjson and I'm going to extend it to use non-standard json (as a compile option, not standard) and I'm curious if anyone foresee any problems with what I'm thinking:
          > >
          > > {
          > > "binary" : <7>7 bytes,
          > > "binary array" : [
          > > <5>ABCDE,
          > > <2>AB,
          > > <3>ABC
          > > ],
          > > "name with : colon" : {
          > > "subitem" : 2
          > > },
          > > "reference to array" : &binary array:2&,
          > > "reference" : &name with \: colon:subitem&
          > > }
          > >
          > > In my time using json the only reasons I've ever had to used XML is when I need to use references or binary data, but I hate xmls complexity, so I want to extend libjson to be able to do that.
          >
          > XML does not have native binary data either; usually base64 encoding
          > is used, and same works well for JSON. Why not use that? Or given that
          > content is just Unicode there is nothing preventing you from just
          > using regular text, limiting to codepoints 0 through 255.
          > And references are typically these are done at layer above JSON, using
          > naming conventions or schema (implicit or explicit) to indicate where
          > a reference is expected. XML has no native notation for these either
          > (unless perhaps general entity references). They are built using
          > layers above.
          >
          > So I am not quite sure why you would want to break syntax-level
          > compatibility to do things that can be done at layer(s) directly above
          > JSON.
          >
          > -+ Tatu +-
          >


          [Non-text portions of this message have been removed]
        • Tatu Saloranta
          ... Ah ok. :) ... Yeah that is one way. Actually there is another, used with HTTP -- you can send binary as separate http body part, refer to that from XML (I
          Message 4 of 4 , Aug 10, 2010
          View Source
          • 0 Attachment
            On Tue, Aug 10, 2010 at 8:03 AM, Jonathan Wallace <ninja9578@...> wrote:
            > Thanks for your input. I guess I never looks at how my XML library handled the binary.

            Ah ok. :)

            >  I guess I'll just add a method to insert binary data that automatically converts it to base64

            Yeah that is one way. Actually there is another, used with HTTP -- you
            can send binary as separate http body part, refer to that from XML (I
            think that's MTOM?).
            Same could be done with JSON as well.

            Good luck!

            -+ Tatu +-
          Your message has been successfully submitted and would be delivered to recipients shortly.