Repository: olingo-odata4 Updated Branches: refs/heads/master 181e46356 -> 9825f36db
OLINGO-682: adding support for Project: http://git-wip-us.apache.org/repos/asf/olingo-odata4/repo Commit: http://git-wip-us.apache.org/repos/asf/olingo-odata4/commit/ce1f6ad8 Tree: http://git-wip-us.apache.org/repos/asf/olingo-odata4/tree/ce1f6ad8 Diff: http://git-wip-us.apache.org/repos/asf/olingo-odata4/diff/ce1f6ad8 Branch: refs/heads/master Commit: ce1f6ad8e95d9e1d7fc578cebf6f4144093cc34e Parents: 181e463 Author: Ramesh Reddy <[email protected]> Authored: Tue Jun 2 17:49:03 2015 -0500 Committer: Ramesh Reddy <[email protected]> Committed: Tue Jun 2 17:49:03 2015 -0500 ---------------------------------------------------------------------- .../core/serializer/json/ODataJsonSerializer.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/olingo-odata4/blob/ce1f6ad8/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java ---------------------------------------------------------------------- diff --git a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java index d5cd3c6..c0c797f 100644 --- a/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java +++ b/lib/server-core/src/main/java/org/apache/olingo/server/core/serializer/json/ODataJsonSerializer.java @@ -330,13 +330,13 @@ public class ODataJsonSerializer implements ODataSerializer { final Link navigationLink = linked.getNavigationLink(property.getName()); final ExpandItem innerOptions = expandAll ? null : ExpandSelectHelper.getExpandItem(expand.getExpandItems(), propertyName); - if (innerOptions != null && (innerOptions.isRef() || innerOptions.getLevelsOption() != null)) { - throw new SerializerException("Expand options $ref and $levels are not supported.", + if (innerOptions != null && innerOptions.getLevelsOption() != null) { + throw new SerializerException("Expand option $levels is not supported.", SerializerException.MessageKeys.NOT_IMPLEMENTED); } writeExpandedNavigationProperty(metadata, property, navigationLink, innerOptions == null ? null : innerOptions.getExpandOption(), - innerOptions == null ? null : innerOptions.getSelectOption(), + innerOptions == null ? null : innerOptions.getSelectOption(), innerOptions.isRef(), json); } } @@ -345,7 +345,8 @@ public class ODataJsonSerializer implements ODataSerializer { protected void writeExpandedNavigationProperty(final ServiceMetadata metadata, final EdmNavigationProperty property, final Link navigationLink, - final ExpandOption innerExpand, final SelectOption innerSelect, final JsonGenerator json) + final ExpandOption innerExpand, final SelectOption innerSelect, boolean onlyReference, + final JsonGenerator json) throws IOException, SerializerException { json.writeFieldName(property.getName()); if (property.isCollection()) { @@ -354,14 +355,14 @@ public class ODataJsonSerializer implements ODataSerializer { json.writeEndArray(); } else { writeEntitySet(metadata, property.getType(), navigationLink.getInlineEntitySet(), innerExpand, - innerSelect, false, json); + innerSelect, onlyReference, json); } } else { if (navigationLink == null || navigationLink.getInlineEntity() == null) { json.writeNull(); } else { writeEntity(metadata, property.getType(), navigationLink.getInlineEntity(), null, - innerExpand, innerSelect, false, json); + innerExpand, innerSelect, onlyReference, json); } } }
