The standard JAXB APIs are used the process the JSON message. Only two properties need to be set: "eclipselink.media.type" to specify "application/json", and "eclipselink.json.include-root" to indicate there is no root node. These properties are set on the Marshaller and Unmarshaller. Since the JSON message does not contain a root node that can be used to determine the corresponding object type, we will leverage one of the Unmarshaller methods that lets us specify it.

+

The standard JAXB APIs are used the process the JSON message. Only two properties need to be set: '''eclipselink.media.type''' to specify '''application/json''', and '''eclipselink.json.include-root''' to indicate there is no root node. These properties are set on the Marshaller and Unmarshaller. Since the JSON message does not contain a root node that can be used to determine the corresponding object type, we will leverage one of the Unmarshaller methods that lets us specify it.

Demo

The standard JAXB APIs are used the process the JSON message. Only two properties need to be set: eclipselink.media.type to specify application/json, and eclipselink.json.include-root to indicate there is no root node. These properties are set on the Marshaller and Unmarshaller. Since the JSON message does not contain a root node that can be used to determine the corresponding object type, we will leverage one of the Unmarshaller methods that lets us specify it.