Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ public static void AddMcpServices(this IServiceCollection services, string schem
static (sp, name) => new McpRequestExecutorProxy(
sp.GetRequiredService<IRequestExecutorProvider>(),
sp.GetRequiredService<IRequestExecutorEvents>(),
#if NET10_0_OR_GREATER
(string)name))
#else
(string)name!))
#endif
.AddKeyedSingleton(
schemaName,
static (sp, name) => new StreamableHttpHandlerProxy(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Buffers;
using System.IO.Pipelines;
using System.Text.Json;
using HotChocolate.Buffers;
using HotChocolate.Fusion.Text.Json;
#else
using System.Buffers;
Expand Down Expand Up @@ -53,7 +54,7 @@ public async IAsyncEnumerator<OperationResult> GetAsyncEnumerator(

#if FUSION
var chunks = ArrayPool<byte[]>.Shared.Rent(64);
var currentChunk = JsonMemory.Rent();
var currentChunk = JsonMemory.Rent(JsonMemoryKind.Json);
var currentChunkPosition = 0;
var chunkIndex = 0;
#else
Expand Down Expand Up @@ -101,7 +102,7 @@ public async IAsyncEnumerator<OperationResult> GetAsyncEnumerator(
}

chunks[chunkIndex++] = currentChunk;
currentChunk = JsonMemory.Rent();
currentChunk = JsonMemory.Rent(JsonMemoryKind.Json);
currentChunkPosition = 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#if !NET9_0_OR_GREATER
using System.Diagnostics.CodeAnalysis;
#endif

namespace ChilliCream.Nitro.CommandLine.Commands.Mcp;

#if !NET9_0_OR_GREATER
[RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
#endif
internal sealed class McpCommand : Command
{
public McpCommand() : base("mcp")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
#if !NET9_0_OR_GREATER
using System.Diagnostics.CodeAnalysis;
#endif

namespace ChilliCream.Nitro.CommandLine.Commands.OpenApi;

#if !NET9_0_OR_GREATER
[RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed and might need runtime code generation. Use System.Text.Json source generation for native AOT applications.")]
[RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
#endif
internal sealed class OpenApiCommand : Command
{
public OpenApiCommand() : base("openapi")
Expand Down
Loading