From c16b0b99978cccbbb2f3f7daa7a19f8b3b5cee9e Mon Sep 17 00:00:00 2001 From: Christian Holzer Date: Tue, 20 Jan 2015 12:54:31 +0100 Subject: [PATCH] [OLINGO-468] Fix: CarsProcessor passes EDM constaints to the primitive serializer Signed-off-by: Michael Bolz --- .../olingo/server/sample/processor/CarsProcessor.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/samples/server/src/main/java/org/apache/olingo/server/sample/processor/CarsProcessor.java b/samples/server/src/main/java/org/apache/olingo/server/sample/processor/CarsProcessor.java index 1b97e9480..f502d925f 100644 --- a/samples/server/src/main/java/org/apache/olingo/server/sample/processor/CarsProcessor.java +++ b/samples/server/src/main/java/org/apache/olingo/server/sample/processor/CarsProcessor.java @@ -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());