}
Class expectedType = apiMethod.getExpectedType();
Object bodyObject = null;
if (MediaType.APPLICATION_JSON_TYPE.equals(mediaType)) {
JSONProvider jsonProvider = new JSONProvider();
bodyObject = jsonProvider.readFrom(expectedType, expectedType.getGenericSuperclass(),
expectedType.getAnnotations(), mediaType, null, request.getInputStream());
} else {
JAXBContext context = JAXBContext.newInstance(expectedType);
Unmarshaller unmarshaller = context.createUnmarshaller();
bodyObject = (Object) unmarshaller.unmarshal(request.getInputStream());