You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@olingo.apache.org by Frédéric SOUCHU <Fr...@ingenico.com> on 2015/04/01 17:11:55 UTC
RE: ODATA V4 - Olingo EDM enum value is string, specs says integer
Linked to this topic, I filled this bug (json serialization exception):
https://issues.apache.org/jira/browse/OLINGO-615?
Looks like there is still some rough corners around enum handling in current beta version!
From: Frédéric SOUCHU
Sent: 31 March 2015 15:59
To: user@olingo.apache.org
Subject: ODATA V4 - Olingo EDM enum value is string, specs says integer
I noticed that ODATA V4 says:
Enumeration types are named primitive types whose values are named constants with underlying integer values.
(cf.: ODATA V4 - Data Model<http://docs.oasis-open.org/odata/odata/v4.0/errata02/os/complete/part1-protocol/odata-v4.0-errata02-os-part1-protocol-complete.html#_Toc406398201>)
However, the Olingo V4 SDK forces the EDM enum definition to use strings:
new EnumMember().setName("Not Available").setValue("-1")
org.apache.olingo.server.api.edm.provider.EnumMember::setValue being defined as such:
public EnumMember setValue(final String value) {
this.value = value;
return this;
}
According to the spec, the API should be:
public EnumMember setValue(final Long value) {
this.value = value;
return this;
}
Is there any plan to change that before Olingo V4 is out of Beta phase?
Regards,
Frederic