This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 353938 - JSON - No root element handling
Summary: JSON - No root element handling
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-04 16:01 EDT by Denise Smith CLA
Modified: 2022-06-09 10:36 EDT (History)
1 user (show)

See Also:


Attachments
Proposed changes and tests (26.21 KB, patch)
2011-08-04 16:28 EDT, Denise Smith CLA
no flags Details | Diff
Updated INCLUDE_ROOT option (43.02 KB, patch)
2011-09-29 14:32 EDT, Denise Smith CLA
no flags Details | Diff
Update - INCLUDE_ROOT option (46.34 KB, patch)
2011-09-29 15:15 EDT, Denise Smith CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Denise Smith CLA 2011-08-04 16:01:26 EDT
In JSON a document can look like this 
{"address"
  {"street":"theStreet",
  "city":"theCity"
  }
}

Or it can exist with no root (in this case no "address")
 {"street":"theStreet",
  "city":"theCity"
  }

We need to be able to unmarshal this.  Since we'll need to provide the class to unmarshal to the object returned will be a JAXBElement (see that JAXBUnmarshaller.unmarshal(Source) returns a JAXBElement).  In this case the QName on the JAXBElement will have an "" local name.  In the marshal case if a QName on a JAXBElement has an "" local name we will treat it as not having a root element.
Comment 1 Denise Smith CLA 2011-08-04 16:28:44 EDT
Created attachment 200943 [details]
Proposed changes and tests
Comment 2 Denise Smith CLA 2011-08-10 11:01:52 EDT
Checked changes in to trunk.  Behavior as described in the bug.
Comment 3 Denise Smith CLA 2011-09-29 14:32:04 EDT
Created attachment 204317 [details]
Updated INCLUDE_ROOT option
Comment 4 Denise Smith CLA 2011-09-29 15:15:21 EDT
Created attachment 204321 [details]
Update - INCLUDE_ROOT option
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:36:15 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink