olingo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject [2/4] git commit: [OLINGO-406] Omit odata.type information for none metadata
Date Wed, 03 Sep 2014 05:49:26 GMT
[OLINGO-406] Omit odata.type information for none metadata


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

Branch: refs/heads/master
Commit: deec7aa854cd3b00d161ea63f5c5151fdaeb3054
Parents: b81a2ee
Author: mibo <mibo@apache.org>
Authored: Mon Sep 1 08:27:07 2014 +0200
Committer: mibo <mibo@apache.org>
Committed: Mon Sep 1 08:27:07 2014 +0200

----------------------------------------------------------------------
 .../olingo/commons/core/serialization/JsonEntitySerializer.java  | 2 +-
 .../apache/olingo/commons/core/serialization/JsonSerializer.java | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/deec7aa8/lib/commons-core/src/main/java/org/apache/olingo/commons/core/serialization/JsonEntitySerializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/serialization/JsonEntitySerializer.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/serialization/JsonEntitySerializer.java
index b7c2f13..5576e19 100644
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/serialization/JsonEntitySerializer.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/serialization/JsonEntitySerializer.java
@@ -74,7 +74,7 @@ public class JsonEntitySerializer extends JsonSerializer {
       }
     }
 
-    if (StringUtils.isNotBlank(entity.getType()) && format == ODataFormat.JSON_FULL_METADATA)
{
+    if (StringUtils.isNotBlank(entity.getType()) && format != ODataFormat.JSON_NO_METADATA)
{
       jgen.writeStringField(version.getJsonName(ODataServiceVersion.JsonKey.TYPE),
               new EdmTypeInfo.Builder().setTypeExpression(entity.getType()).build().external(version));
     }

http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/deec7aa8/lib/commons-core/src/main/java/org/apache/olingo/commons/core/serialization/JsonSerializer.java
----------------------------------------------------------------------
diff --git a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/serialization/JsonSerializer.java
b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/serialization/JsonSerializer.java
index b6f857f..6955b11 100755
--- a/lib/commons-core/src/main/java/org/apache/olingo/commons/core/serialization/JsonSerializer.java
+++ b/lib/commons-core/src/main/java/org/apache/olingo/commons/core/serialization/JsonSerializer.java
@@ -314,7 +314,7 @@ public class JsonSerializer implements ODataSerializer {
       throws IOException, EdmPrimitiveTypeException {
     jgen.writeStartObject();
 
-    if (typeInfo != null && format == ODataFormat.JSON_FULL_METADATA) {
+    if (typeInfo != null && format != ODataFormat.JSON_NO_METADATA) {
       jgen.writeStringField(version.getJsonName(ODataServiceVersion.JsonKey.TYPE), typeInfo.external(version));
     }
 
@@ -361,7 +361,7 @@ public class JsonSerializer implements ODataSerializer {
       if (StringUtils.isBlank(type) && valuable.isPrimitive() || valuable.isNull())
{
         type = EdmPrimitiveTypeKind.String.getFullQualifiedName().toString();
       }
-      if (StringUtils.isNotBlank(type) && format == ODataFormat.JSON_FULL_METADATA)
{
+      if (StringUtils.isNotBlank(type) && format != ODataFormat.JSON_NO_METADATA)
{
         jgen.writeFieldName(
                 name + StringUtils.prependIfMissing(version.getJsonName(ODataServiceVersion.JsonKey.TYPE),
"@"));
         jgen.writeString(new EdmTypeInfo.Builder().setTypeExpression(type).build().external(version));


Mime
View raw message