Skip to content

Commit 584b4e8

Browse files
author
Chris Santero
committed
Revert "only fetch link ID if link template requests it"
This reverts commit 3cc0280.
1 parent 3cc0280 commit 584b4e8

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

JSONAPI/Json/JsonApiFormatter.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,8 @@ protected void Serialize(object value, Stream writeStream, JsonWriter writer, Js
319319
break;
320320
case SerializeAsOptions.Link:
321321
if (lt == null) throw new JsonSerializationException("A property was decorated with SerializeAs(SerializeAsOptions.Link) but no LinkTemplate attribute was provided.");
322-
323-
string linkId = lt.Contains("{0}") ? GetIdFor(value) : null;
324-
string href = String.Format(lt, null, linkId);
322+
//TODO: Check for "{0}" in linkTemplate and (only) if it's there, get the Ids of all objects and "implode" them.
323+
string href = String.Format(lt, null, GetIdFor(value));
325324
//writer.WritePropertyName(ContractResolver._modelManager.GetJsonKeyForProperty(prop));
326325
//TODO: Support ids and type properties in "link" object
327326
writer.WriteStartObject();

0 commit comments

Comments
 (0)