Hide experimental types from external source generators using internal property pattern (#1301)

This commit is contained in:
Mackinnon Buck 2026-02-19 07:27:30 -08:00 • committed by GitHub
commit cc6ef5b926
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,3 +1,4 @@
using System.Diagnostics.CodeAnalysis;
using System.Text.Json;
using System.Text.Json.Serialization;
@ -33,6 +34,16 @@ public sealed class CallToolRequestParams : RequestParams
/// When present, indicates that the requestor wants this operation executed as a task.
/// The receiver must support task augmentation for this specific request type.
/// </remarks>
[Experimental(Experimentals.Tasks_DiagnosticId, UrlFormat = Experimentals.Tasks_Url)]
[JsonIgnore]
public McpTaskMetadata? Task
{
get => TaskCore;
set => TaskCore = value;
}
// See ExperimentalInternalPropertyTests.cs before modifying this property.
[JsonInclude]
[JsonPropertyName("task")]
public McpTaskMetadata? Task { get; set; }
internal McpTaskMetadata? TaskCore { get; set; }
}