[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [eclipselink-users] Unmarshalling JSON with unknown property with null value
|
Sorry if the "What gives?" comes off as rude. I was shooting for flip, not cranky.
Is there a chance this is a bug? I figure it might also be a setting somewhere, but bug seems more likely to me.
Thanks,
Eric
-----Original Message-----
From: eclipselink-users-bounces@xxxxxxxxxxx [mailto:eclipselink-users-bounces@xxxxxxxxxxx] On Behalf Of Eric Stein
Sent: Thursday, August 21, 2014 9:56 AM
To: eclipselink-users@xxxxxxxxxxx
Subject: [eclipselink-users] Unmarshalling JSON with unknown property with null value
I'm using MOXy to unmarshall incoming JSON to my Jersey API. I have a POJO with three properties: databaseName, initialQuery, and runQueryAsUser. I have a client sending me a POST where the JSON has an additional property that I don't need, secureQuery. When the value of secureQuery is null, MOXy spits back a null object. When the value of secureQuery is the empty string, MOXy returns a valid object with the three properties set and secureQuery correctly ignored. The only annotation the POJO has is `@XmlRootElement(name = "InitialQuery")`.
What gives?
Version:
jersey-media-moxy: 2.6
org.eclipse.persistence.moxy: 2.5.0
Method Signature:
public Response createSecuredQuery(final InitialQueryBean initialQuery) {
Null InitialQuery object:
{
"databaseName":"MyDatabase",
"initialQuery":"select 1",
"runQueryAsUser":"bob",
"secureQuery":null
}
Good InitialQuery object:
{
"databaseName":"MyDatabase",
"initialQuery":"select 1",
"runQueryAsUser":"bob",
"secureQuery":""
}
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit https://dev.eclipse.org/mailman/listinfo/eclipselink-users