Skip to content

Commit 8d34456

Browse files
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 1bb4c99 commit 8d34456

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

src/Azure.DataApiBuilder.Mcp/Core/DynamicCustomTool.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -442,13 +442,14 @@ private JsonElement BuildInputSchemaFromConfig()
442442
/// </summary>
443443
private static bool IsParameterRequired(bool? configuredRequired, bool hasDefault)
444444
{
445-
if (configuredRequired is not null)
445+
// If the engine can supply a default when the caller omits the parameter,
446+
// it should not be advertised as required.
447+
if (hasDefault)
446448
{
447-
return configuredRequired.Value;
449+
return false;
448450
}
449451

450-
// No explicit config: a parameter is required unless a default is available.
451-
return !hasDefault;
452+
return configuredRequired ?? true;
452453
}
453454

454455
/// <summary>

0 commit comments

Comments
 (0)