olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chr...@apache.org
Subject olingo-odata4 git commit: [OLINGO-609] Fix: ODataJsonDeserializer
Date Tue, 31 Mar 2015 10:57:41 GMT
Repository: olingo-odata4
Updated Branches:
  refs/heads/master 62f100148 -> 92e201b0a


[OLINGO-609] Fix: ODataJsonDeserializer


Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo
Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/92e201b0
Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/92e201b0
Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/92e201b0

Branch: refs/heads/master
Commit: 92e201b0a828370bb747c79a8479959d5f491a8e
Parents: 62f1001
Author: Christian Holzer <c.holzer@sap.com>
Authored: Tue Mar 31 12:52:02 2015 +0200
Committer: Christian Holzer <c.holzer@sap.com>
Committed: Tue Mar 31 12:52:02 2015 +0200

----------------------------------------------------------------------
 .../server/core/deserializer/json/ODataJsonDeserializer.java      | 2 +-
 .../apache/olingo/server/tecsvc/provider/PropertyProvider.java    | 3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/92e201b0/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
----------------------------------------------------------------------
diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
index a15d84a..ed3454c 100644
--- a/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
+++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/deserializer/json/ODataJsonDeserializer.java
@@ -290,7 +290,7 @@ public class ODataJsonDeserializer implements ODataDeserializer {
       if (jsonNode != null) {
         EdmNavigationProperty edmNavigationProperty = edmEntityType.getNavigationProperty(navigationPropertyName);
         boolean isNullable = edmNavigationProperty.isNullable();
-        if (jsonNode.isNull() && !isNullable) {
+        if ((jsonNode.isNull() && !isNullable) || (jsonNode.isNull() && edmNavigationProperty.isCollection()))
{
           throw new DeserializerException("Property: " + navigationPropertyName + " must
not be null.",
               DeserializerException.MessageKeys.INVALID_NULL_PROPERTY, navigationPropertyName);
         }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/92e201b0/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
----------------------------------------------------------------------
diff --git a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
index bd2ec5b..c21fbce 100644
--- a/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
+++ b/lib/server-tecsvc/src/main/java/org/apache/olingo/server/tecsvc/provider/PropertyProvider.java
@@ -658,8 +658,7 @@ public class PropertyProvider {
   public static final NavigationProperty collectionNavPropertyETTwoPrimMany_ETTwoPrim = new
NavigationProperty()
           .setName("NavPropertyETTwoPrimMany")
           .setType(EntityTypeProvider.nameETTwoPrim)
-          .setCollection(true)
-          .setNullable(false);
+          .setCollection(true);
 
   public static final NavigationProperty collectionNavPropertyETAllPrimMany_ETAllPrim = new
NavigationProperty()
           .setName("NavPropertyETAllPrimMany")


Mime
View raw message