Skip to content

Commit 62afcfb

Browse files
ewoutkramerclaude
andcommitted
Fix CI build: preserve binary compat for FindMappedElementByChoiceName
The Azure Pipelines build failed on the Pack step with API compatibility error CP0002: adding an optional 'ignoreCase' parameter to the existing public FindMappedElementByChoiceName(string) method changed its IL signature, breaking binary compatibility against the 6.2.0 baseline (EnablePackageValidation is on for this repo). Split into two overloads instead: the original single-parameter method is preserved unchanged and delegates to a new two-parameter overload. Verified locally with 'dotnet pack --no-build', which reproduces the same API compat check the pipeline runs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent d3fcaf8 commit 62afcfb

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/Hl7.Fhir.Base/Introspection/ClassMapping.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,19 @@ PropertyMappingCollection createCollection()
243243
/// so for where there is no suffix. In this case, however, <see cref="FindMappedElementByName(string)"/>
244244
/// is faster.
245245
/// </remarks>
246-
public PropertyMapping? FindMappedElementByChoiceName(string name, bool ignoreCase = false)
246+
public PropertyMapping? FindMappedElementByChoiceName(string name) => FindMappedElementByChoiceName(name, ignoreCase: false);
247+
248+
/// <summary>
249+
/// Returns the mapping for an element of this class by a name that
250+
/// might be suffixed by a type name (e.g. for choice elements).
251+
/// </summary>
252+
/// <param name="name">The (possibly suffixed) name to look up.</param>
253+
/// <param name="ignoreCase">If <c>true</c>, the choice prefix is matched case-insensitively.</param>
254+
/// <remarks>Will also return properties for which the name is exactly the same,
255+
/// so for where there is no suffix. In this case, however, <see cref="FindMappedElementByName(string)"/>
256+
/// is faster.
257+
/// </remarks>
258+
public PropertyMapping? FindMappedElementByChoiceName(string name, bool ignoreCase)
247259
{
248260
if (name == null) throw Error.ArgumentNull(nameof(name));
249261

0 commit comments

Comments
 (0)