[OLINGO-1490] Update(PUT) Collection Property
This commit is contained in:
parent
4aba5b9f92
commit
a50c098644
|
@ -563,7 +563,20 @@ public class ODataDispatcher {
|
|||
ODataHandlerException.MessageKeys.INVALID_PAYLOAD);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
} else if (method == HttpMethod.PUT && uriInfo.getUriResourceParts().size()==2) {
|
||||
if (isMedia) {
|
||||
validatePreferHeader(request);
|
||||
}
|
||||
validatePreconditions(request, false);
|
||||
final ContentType requestFormat = getSupportedContentType(
|
||||
request.getHeader(HttpHeader.CONTENT_TYPE),
|
||||
RepresentationType.ENTITY, true);
|
||||
final ContentType responseFormat = ContentNegotiator.
|
||||
doContentNegotiation(uriInfo.getFormatOption(),
|
||||
request, handler.getCustomContentTypeSupport(), RepresentationType.ENTITY);
|
||||
handler.selectProcessor(EntityProcessor.class)
|
||||
.updateEntity(request, response, uriInfo, requestFormat, responseFormat);
|
||||
} else {
|
||||
throwMethodNotAllowed(method);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,13 +140,9 @@ public class RequestValidator {
|
|||
if (edmProperty.isCollection()) {
|
||||
final EntityCollection inlineEntitySet = navigationLink.getInlineEntitySet();
|
||||
if (inlineEntitySet != null) {
|
||||
if (!isInsert && inlineEntitySet.getEntities().size() > 0) {
|
||||
throw new DataProvider.DataProviderException("Deep update is not allowed", HttpStatusCode.BAD_REQUEST);
|
||||
} else {
|
||||
for (final Entity entity : navigationLink.getInlineEntitySet().getEntities()) {
|
||||
validate(edmBindingTarget, entity);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
final Entity inlineEntity = navigationLink.getInlineEntity();
|
||||
|
|
|
@ -748,7 +748,7 @@ public class ODataHandlerImplTest {
|
|||
|
||||
dispatchMethodNotAllowed(HttpMethod.PATCH, sigletonManyNavUri, processor);
|
||||
|
||||
dispatchMethodNotAllowed(HttpMethod.PUT, sigletonManyNavUri, processor);
|
||||
dispatch(HttpMethod.PUT, sigletonManyNavUri, processor);
|
||||
|
||||
dispatch(HttpMethod.POST, sigletonManyNavUri, processor);
|
||||
verify(processor).createEntity(
|
||||
|
|
Loading…
Reference in New Issue