[OLINGO-468] Fix: CarsProcessor passes EDM constaints to the primitive serializer

Signed-off-by: Michael Bolz <michael.bolz@sap.com>
This commit is contained in:
Christian Holzer 2015-01-20 12:54:31 +01:00 committed by Michael Bolz
parent b6c1e347c7
commit c16b0b9997

View File

@ -272,7 +272,13 @@ public class CarsProcessor implements EntityCollectionProcessor, EntityProcessor
serializer.complex((EdmComplexType) edmProperty.getType(), property,
ComplexSerializerOptions.with().contextURL(contextURL).build()) :
serializer.primitive((EdmPrimitiveType) edmProperty.getType(), property,
PrimitiveSerializerOptions.with().contextURL(contextURL).build());
PrimitiveSerializerOptions.with()
.contextURL(contextURL)
.scale(edmProperty.getScale())
.nullable(edmProperty.isNullable())
.precision(edmProperty.getPrecision())
.maxLength(edmProperty.getMaxLength())
.unicode(edmProperty.isUnicode()).build());
response.setContent(serializerContent);
response.setStatusCode(HttpStatusCode.OK.getStatusCode());
response.setHeader(HttpHeader.CONTENT_TYPE, contentType.toContentTypeString());