EndpointResponse response = phaseContext.getEndpointResponse();
ApiVersionPlugin<ApiObject,PersistentObject> apiVersionPlugin = phaseContext.getVersionPlugin();
EntityPlugin plugin = phaseContext.getEntityPlugin();
PersistenceContext persistenceContext = buildPersistenceContext(phaseContext);
RequestContext<ApiObject> requestContext = marshaller.unmarshallWithContext(request.getInputStream(), apiVersionPlugin.getApiClass());
ApiObject clientObject = requestContext.getRequestObject();
List ids = plugin.getKeyConverter().covertKeys(phaseContext.getId());
if(ids.size() != 1)
throw new BadRequestException("A single id must be provided for an update.");
Set<String> setFields = requestContext.getSetFields();
persistenceContext.setProvidedFields(setFields);
Set<String> fieldSet = persistenceContext.getRequestedFields();
if(fieldSet != null)
fieldSet.add("id");
ApiObject saved = plugin.getPersistenceOperations().updateItem(ids, clientObject, persistenceContext);