Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.1
    • Component/s: None
    • Labels:
      None

      Description

      Using JQuery on the browser side in conjunction with GET or POST operations, the root var name is typlically 'data'. If you serialized a simpl String through XStream with the JSON driver, you'd be given

      { string : "foo " }

      or similar.

      In the JavaScript in the browser, you'd address that as ...

         alert( data.string );  
      

      It would be nice to address it simply as ...

        alert(data);
      

      Can we have a switch on the Json Driver : noRootNode(true); ?

        Issue Links

          Activity

          Hide
          Jörg Schaible added a comment -

          Neither

          "value"
          

          nor

          { "value" }
          

          is valid JSON.

          The current JSON driver already has this no root flag (see XSTR-434), but will throw a ConversionException for a single value.

          Show
          Jörg Schaible added a comment - Neither "value" nor { "value" } is valid JSON. The current JSON driver already has this no root flag (see XSTR-434 ), but will throw a ConversionException for a single value.
          Hide
          Jörg Schaible added a comment -

          The new JsonWriter does support now also a mode to return simple values although it violates JSON. If created a new SNAPSHOT for your convenience.

          Show
          Jörg Schaible added a comment - The new JsonWriter does support now also a mode to return simple values although it violates JSON. If created a new SNAPSHOT for your convenience.
          Hide
          Jörg Schaible added a comment -

          Set correct fix version.

          Show
          Jörg Schaible added a comment - Set correct fix version.
          Hide
          Jörg Schaible added a comment -

          Fixed for upcoming release.

          Show
          Jörg Schaible added a comment - Fixed for upcoming release.

            People

            • Assignee:
              Jörg Schaible
              Reporter:
              Paul Hammant
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: