Skip to content

Commit 828dce8

Browse files
Port SAP B1 V3-style select on expanded entities
Re-apply the GeneXus extension that lets consumers encode column paths with '~' instead of '/' to opt into V3-style select on expanded entities (SAP B1 services do not accept V4 nested $select syntax). The escape is unwound in V4 CommandFormatter.SelectPathSegmentColumns right before returning, after the column filtering has run with the V4-style first-segment matching intact. Original commit: ee78142 'Add support for V3-style select on expanded entities'. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e81fcab commit 828dce8

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

src/Simple.OData.Client.V4.Adapter/CommandFormatter.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,12 @@ private static void MergeOrderByColumns(ODataExpandAssociation expandAssociation
273273
}
274274
}
275275

276+
// Consumers that need V3-style select on expanded entities (e.g. SAP B1, which
277+
// does not accept V4 nested $select syntax) can encode column paths with '~'
278+
// instead of '/'. The escape is unwound here so the formatter emits a flat
279+
// $select column list containing slashes.
280+
private const char ODataV3FormattingEscapeSeparator = '~';
281+
276282
private IList<string> SelectPathSegmentColumns(
277283
IList<string> columns, EntityCollection collection, IList<string> expandedPaths)
278284
{
@@ -283,6 +289,7 @@ private IList<string> SelectPathSegmentColumns(
283289

284290
return columns
285291
.Where(x => !expandedNavigationProperties.Any(y => y.Equals(FormatFirstSegment(x), StringComparison.Ordinal)))
292+
.Select(x => x.Replace(ODataV3FormattingEscapeSeparator, '/'))
286293
.ToList();
287294
}
288295

0 commit comments

Comments
 (0)