Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions src/vanilla/ClientModelExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private static string GetSeparator(this CollectionFormat format)
}

/// <summary>
/// Format the value of a sequence given the modeled element format. Note that only sequences of strings are supported.
/// Format the value of a sequence given the modeled element format.
/// </summary>
/// <param name="parameter">The parameter to format.</param>
/// <returns>A reference to the formatted parameter value.</returns>
Expand All @@ -191,19 +191,6 @@ public static string GetFormattedReferenceValue(this Parameter parameter)
return parameter.Name;
}

PrimaryType primaryType = sequence.ElementType as PrimaryType;
EnumType enumType = sequence.ElementType as EnumType;
if (enumType != null && enumType.ModelAsString)
{
primaryType = New<PrimaryType>(KnownPrimaryType.String);
}

if (primaryType == null || primaryType.KnownPrimaryType != KnownPrimaryType.String)
{
throw new InvalidOperationException(
"Cannot generate a formatted sequence from a " + $"non-string array parameter {parameter}");
}

return string.Format("{0}.nil? ? nil : {0}.join('{1}')", parameter.Name, parameter.CollectionFormat.GetSeparator());
}

Expand Down