Skip to content

Commit 4a7d3f5

Browse files
PederHPgirishkvsclaude
committed
Widen PaginatedRequestParams and PaginatedResult constructors to protected
Both base classes had private protected constructors, so a package outside Core could not implement a paginated method. The Skills extension's skills/list is paginated. Widening to protected is source and binary compatible and passes package validation against the 2.0.0 baseline. Carried over from modelcontextprotocol#1856. Co-authored-by: Girish Konda <[email protected]> Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01P6omaTvQiryHtzFHRqUE3b
1 parent 3338e88 commit 4a7d3f5

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎src/ModelContextProtocol.Core/Protocol/PaginatedRequest.cs‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,14 @@ namespace ModelContextProtocol.Protocol;
1010
/// </remarks>
1111
public abstract class PaginatedRequestParams : RequestParams
1212
{
13-
/// <summary>Prevent external derivations.</summary>
14-
private protected PaginatedRequestParams()
13+
/// <summary>
14+
/// Initializes a new instance of the <see cref="PaginatedRequestParams"/> class.
15+
/// </summary>
16+
/// <remarks>
17+
/// This constructor is <see langword="protected"/> rather than <c>private protected</c> so that extension
18+
/// packages implementing paginated methods defined outside the core specification can derive from it.
19+
/// </remarks>
20+
protected PaginatedRequestParams()
1521
{
1622
}
1723

‎src/ModelContextProtocol.Core/Protocol/PaginatedResult.cs‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,14 @@ namespace ModelContextProtocol.Protocol;
1717
/// </remarks>
1818
public abstract class PaginatedResult : Result
1919
{
20-
private protected PaginatedResult()
20+
/// <summary>
21+
/// Initializes a new instance of the <see cref="PaginatedResult"/> class.
22+
/// </summary>
23+
/// <remarks>
24+
/// This constructor is <see langword="protected"/> rather than <c>private protected</c> so that extension
25+
/// packages implementing paginated methods defined outside the core specification can derive from it.
26+
/// </remarks>
27+
protected PaginatedResult()
2128
{
2229
}
2330

0 commit comments

Comments
 (0)