Community
Participate
Working Groups
Special handling of JSON type property should be deprecated. If there is need to identify type of JSON object - due to missing root element or some special inheritance requirements, it should be necessary to specify fully qualified type property with http://www.w3.org/2001/XMLSchema-instance namespace. Namespace prefix needs to be specified as JAXBContext property in JAXB Context or Marshaller or Unmarshaller: unmarshaller.setProperty(JAXBContextProperties.MEDIA_TYPE, MediaType.APPLICATION_JSON); Map<String, String> namespaces = new HashMap<>(); namespaces.put(javax.xml.XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI, "xsi"); unmarshaller.setProperty(JAXBContextProperties.NAMESPACE_PREFIX_MAPPER, namespaces); Json in MOXy 2.5.x: { "person": { "type": "developer", "name": "Martin Vojtek" } } Json in MOXy 2.6.0: { "person": { "xsi.type": "developer", "name": "Martin Vojtek" } } There should also be change in default handling of simple xsd types when using namespaces. To specify simle xsd type as type value, there should be no need to specify xsd prefix. Example: Json in MOXy 2.5.x: { "foo": { "field": { "xsi.type": "xsd.int", "value": 10 } } } Json in MOXy 2.6.0: { "foo": { "field": { "xsi.type": "int", "value": 10 } } } To provide backward compatibility options, new system properties and JAXBContext/Marshaller/Unmarshaller properties should be introduced: org.eclipse.persistence.json.type-compatibility org.eclipse.persistence.json.use-xsd-types-prefix
Design doc created https://wiki.eclipse.org/EclipseLink/DesignDocs/459464
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink