Bug 452207 - Enhance JSON encoding for Maps
Summary: Enhance JSON encoding for Maps
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-19 03:13 EST by Philipp Plogmann CLA
Modified: 2022-06-09 10:02 EDT (History)
2 users (show)

See Also:


Attachments
Demo app showing JSON encoding difference Moxy and Jackson and GWT problems (8.13 MB, application/x-zip-compressed)
2014-11-21 06:08 EST, Philipp Plogmann CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Plogmann CLA 2014-11-19 03:13:16 EST
We are developing an application that target Wildfly and Glassfish as runtime servers. We love Eclipseling for enforcing the rules on the JPA side. But with Moxy we had a few problems. 

- The deafault encoding of Maps. Wildfly uses the Jackson encoding and that works great with our GWT client application. The Moxy encoding is not readable
- The same is true if Enums are sent as Root-Object. Although I am not sure if this is a valid usecase it works without problems using the Jackson encoding.

I filed a corresponding bug on the Glassfish tracker: https://java.net/jira/browse/GLASSFISH-21252

Thanks for your hard work
Comment 1 Philipp Plogmann CLA 2014-11-19 03:13:56 EST
I forgot to add that we are using the latest Glassfish 4.1 and the corresponding Moxy version.
Comment 2 Iaroslav Savytskyi CLA 2014-11-21 03:48:18 EST
Hi Philipp,

Look like we have some bug. Can you please provide small testCase for us, so we'll be able to fix it.

Thanks in advance.
Comment 3 Philipp Plogmann CLA 2014-11-21 06:06:53 EST
Hi,

I have added a small Demo web-application which demonstrates our problems.

The Demo contains 3 use cases

1. Root-Enum
2. Root-Map
3. Map in Object

The differnent responses are shown below. When you deploy the application on Glassfish and open it (http://localhost:8080/jaxrs-json.test-0.0.1-SNAPSHOT/) you will see error on the client side GWT parsing. If you add Jackson libs to GF or deploy on Wildfly it will work as expected.

Jackson
Enum: "VAL_1"
Root-Map: {"key1":"First String","key2":" Second String"}
Object-Map:
Moxy
Enum: {"value":"VAL_1"}
Root-Map: Error
Object-Map: {"map":{"entry":[{"key":"key1","value":"First String"},{"key":"key2","value":" Second String"}]}}
Comment 4 Philipp Plogmann CLA 2014-11-21 06:08:50 EST
Created attachment 248813 [details]
Demo app showing JSON encoding difference Moxy and Jackson and GWT problems
Comment 5 Philipp Plogmann CLA 2014-11-21 06:11:18 EST
I forgot the Jackson Object Map Json: 
{"map":{"key1":"First String","key2":" Second String"}}
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:02:26 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink