diff --git a/CSharpToJsonSchema.sln b/CSharpToJsonSchema.sln
index 9c3eb17..dc76490 100755
--- a/CSharpToJsonSchema.sln
+++ b/CSharpToJsonSchema.sln
@@ -1,7 +1,6 @@
-
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30204.135
+# Visual Studio Version 17
+VisualStudioVersion = 17.12.35506.116 d17.12
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E793AF18-4371-4EBD-96FC-195EB1798855}"
ProjectSection(SolutionItems) = preProject
@@ -25,9 +24,9 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{2D8B78DE-7269-417B-9D0B-8981FA513ACB}"
ProjectSection(SolutionItems) = preProject
.github\workflows\auto-merge.yml = .github\workflows\auto-merge.yml
+ .github\dependabot.yml = .github\dependabot.yml
.github\workflows\dotnet.yml = .github\workflows\dotnet.yml
.github\workflows\pull-request.yml = .github\workflows\pull-request.yml
- .github\dependabot.yml = .github\dependabot.yml
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharpToJsonSchema", "src\libs\CSharpToJsonSchema\CSharpToJsonSchema.csproj", "{93367DED-6C55-4267-923A-4412D03376FB}"
@@ -80,10 +79,14 @@ Global
{6167F915-83EB-42F9-929B-AD4719A55811}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6167F915-83EB-42F9-929B-AD4719A55811}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6167F915-83EB-42F9-929B-AD4719A55811}.Release|Any CPU.Build.0 = Release|Any CPU
- {1942E3E5-F151-4C90-BECE-140AAD8C66DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1942E3E5-F151-4C90-BECE-140AAD8C66DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DC07C90E-A58C-44B3-82D2-E2EB8F777B92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DC07C90E-A58C-44B3-82D2-E2EB8F777B92}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DC07C90E-A58C-44B3-82D2-E2EB8F777B92}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DC07C90E-A58C-44B3-82D2-E2EB8F777B92}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1942E3E5-F151-4C90-BECE-140AAD8C66DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1942E3E5-F151-4C90-BECE-140AAD8C66DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1942E3E5-F151-4C90-BECE-140AAD8C66DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1942E3E5-F151-4C90-BECE-140AAD8C66DE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/src/libs/CSharpToJsonSchema.Generators/Conversion/ToModels.cs b/src/libs/CSharpToJsonSchema.Generators/Conversion/ToModels.cs
index f3b8a37..bbfa68a 100644
--- a/src/libs/CSharpToJsonSchema.Generators/Conversion/ToModels.cs
+++ b/src/libs/CSharpToJsonSchema.Generators/Conversion/ToModels.cs
@@ -136,6 +136,7 @@ public static InterfaceData PrepareMethodData(
return string.Join(".", commonParts);
}
+
private static OpenApiSchema ToParameterData(ITypeSymbol typeSymbol, string? name = null,
string? description = null, bool isRequired = true)
{
diff --git a/src/libs/CSharpToJsonSchema.Generators/Sources.Method.MeaiTools.cs b/src/libs/CSharpToJsonSchema.Generators/Sources.Method.MeaiTools.cs
index e785c8f..dc0b11b 100644
--- a/src/libs/CSharpToJsonSchema.Generators/Sources.Method.MeaiTools.cs
+++ b/src/libs/CSharpToJsonSchema.Generators/Sources.Method.MeaiTools.cs
@@ -30,7 +30,7 @@ public partial class {extensionsClassName}
foreach (var tool in tools)
{{
var call = calls[tool.Name];
- lst.Add(new global::CSharpToJsonSchema.MeaiFunction(tool, call));
+ lst.Add(new global::CSharpToJsonSchema.MeaiFunction(tool, call, global::{@interface.Namespace}.{extensionsClassName}JsonSerializerContext.Default.Options));
}}
return lst;
}}
@@ -59,7 +59,7 @@ public partial class {extensionsClassName}
foreach (var tool in tools)
{{
var call = calls[tool.Name];
- lst.Add(new global::CSharpToJsonSchema.MeaiFunction(tool, call));
+ lst.Add(new global::CSharpToJsonSchema.MeaiFunction(tool, call, global::{@interface.Namespace}.{extensionsClassName}JsonSerializerContext.Default.Options));
}}
return lst;
}}
diff --git a/src/libs/CSharpToJsonSchema/MeaiFunction.cs b/src/libs/CSharpToJsonSchema/MeaiFunction.cs
index b8bfe10..a55d546 100644
--- a/src/libs/CSharpToJsonSchema/MeaiFunction.cs
+++ b/src/libs/CSharpToJsonSchema/MeaiFunction.cs
@@ -1,6 +1,8 @@
using System.Collections.ObjectModel;
using System.Text.Json;
using System.Text.Json.Nodes;
+using System.Text.Json.Serialization;
+using System.Text.Json.Serialization.Metadata;
using Microsoft.Extensions.AI;
namespace CSharpToJsonSchema;
@@ -29,6 +31,8 @@ public partial class MeaiFunction : AIFunction
/// Gets the description of the tool.
///
public override string Description => _tool.Description;
+
+ private JsonSerializerOptions? _options;
///
/// Gets additional properties associated with the tool.
@@ -40,7 +44,7 @@ public partial class MeaiFunction : AIFunction
///
/// The tool associated with this function.
/// The function to execute the tool with input arguments.
- public MeaiFunction(Tool tool, Func> call)
+ public MeaiFunction(Tool tool, Func> call, JsonSerializerOptions? options = null)
{
this._tool = tool;
this._call = call;
@@ -53,8 +57,31 @@ public MeaiFunction(Tool tool, Func> cal
{
tool.AdditionalProperties.Add("Strict", true);
}
+
+ _options = options;
}
+
+
+ private JsonSerializerOptions InitializeReflectionOptions()
+ {
+ #pragma warning disable IL2026, IL3050 // Reflection is used only when enabled
+ if(!JsonSerializer.IsReflectionEnabledByDefault)
+ throw new InvalidOperationException("JsonSerializer.IsReflectionEnabledByDefault is false, please pass in a JsonSerializerOptions instance.");
+
+ _options = new JsonSerializerOptions()
+ {
+ PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
+ DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
+ PropertyNameCaseInsensitive = true,
+ Converters = { new JsonStringEnumConverter() },
+ TypeInfoResolver = new DefaultJsonTypeInfoResolver()
+ };
+ return _options;
+ #pragma warning restore IL2026, IL3050 // Reflection is used only when enabled
+ }
+
+
///
/// Invokes the tool with the given arguments asynchronously.
///
@@ -76,7 +103,7 @@ public MeaiFunction(Tool tool, Func> cal
///
/// The arguments to be converted into a JSON string.
/// A JSON string representation of the arguments.
- private string GetArgsString(IEnumerable> arguments)
+ protected virtual string GetArgsString(IEnumerable> arguments)
{
var jsonObject = new JsonObject();
@@ -93,6 +120,43 @@ private string GetArgsString(IEnumerable> argument
}
else if (args.Value is JsonNode node)
{
+ jsonObject[args.Key] = node;
+ }
+ else if (args.Value is JsonValue val)
+ {
+ jsonObject[args.Key] = val;
+ }
+ else if( args.Value is JsonObject obj)
+ {
+ jsonObject[args.Key] = obj;
+ }
+ else if (args.Value is JsonArray arr)
+ {
+ jsonObject[args.Key] = arr;
+ }
+ else
+ {
+ var type = args.Value?.GetType();
+ // if(type.IsPrimitive)
+ // {
+ // jsonObject[args.Key] = JsonValue.Create(args.Value);
+ // }
+ // else
+ // {
+ if (_options == null)
+ {
+ #pragma warning disable IL2026, IL3050 // Reflection is used only when enabled
+ //Fallback to Reflection
+ //This will break the AOT, Hoping for the best, IChatClient implementation only send JSON classes
+ //Or Developer is using the code generator
+ _options = InitializeReflectionOptions();
+ #pragma warning disable IL2026, IL3050 // Reflection is used only when enabled
+ }
+ var typeInfo = _options.GetTypeInfo(type);
+
+ var str = JsonSerializer.Serialize(args.Value, typeInfo);
+ jsonObject[args.Key] = JsonNode.Parse(str);
+ //}
}
}
diff --git a/src/libs/CSharpToJsonSchema/TypeToSchemaHelpers.cs b/src/libs/CSharpToJsonSchema/TypeToSchemaHelpers.cs
index 193a806..9b12d0e 100644
--- a/src/libs/CSharpToJsonSchema/TypeToSchemaHelpers.cs
+++ b/src/libs/CSharpToJsonSchema/TypeToSchemaHelpers.cs
@@ -52,7 +52,7 @@ public static OpenApiSchema AsJsonSchema(
JsonSerializerOptions? options = null)
{
type = type ?? throw new ArgumentNullException(nameof(type));
-#pragma warning disable IL2026
+#pragma warning disable IL2026, IL3050
var node = new JsonSerializerOptions
{
TypeInfoResolver = jsonTypeInfoResolver ?? new DefaultJsonTypeInfoResolver(),
@@ -61,7 +61,7 @@ public static OpenApiSchema AsJsonSchema(
TransformSchemaNode = (context, node) => node,
TreatNullObliviousAsNonNullable = true,
});
-#pragma warning restore IL2026
+#pragma warning restore IL2026, IL3050
var schema = Create(type, strict);
if (schema.Type == "object")
{
diff --git a/src/tests/CSharpToJsonSchema.MeaiTests/CSharpToJsonSchema.MeaiTests.csproj b/src/tests/CSharpToJsonSchema.MeaiTests/CSharpToJsonSchema.MeaiTests.csproj
index d7afcce..2c1f6e0 100644
--- a/src/tests/CSharpToJsonSchema.MeaiTests/CSharpToJsonSchema.MeaiTests.csproj
+++ b/src/tests/CSharpToJsonSchema.MeaiTests/CSharpToJsonSchema.MeaiTests.csproj
@@ -9,6 +9,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
+
all
diff --git a/src/tests/CSharpToJsonSchema.MeaiTests/Meai_Tests.cs b/src/tests/CSharpToJsonSchema.MeaiTests/Meai_Tests.cs
index e8113f1..c621a2f 100644
--- a/src/tests/CSharpToJsonSchema.MeaiTests/Meai_Tests.cs
+++ b/src/tests/CSharpToJsonSchema.MeaiTests/Meai_Tests.cs
@@ -1,5 +1,6 @@
using System.ClientModel;
using CSharpToJsonSchema.MeaiTests.Services;
+using GenerativeAI.Microsoft;
using Microsoft.Extensions.AI;
using OpenAI;
using OpenAI.Models;
@@ -34,7 +35,6 @@ public async Task ShouldInvokeTheFunctions()
.Be(true);
Console.WriteLine(response.Text);
-
}
//[TestMethod]
@@ -47,9 +47,10 @@ public async Task ShouldInvokeTheBookService()
var client = new OpenAIClient(new ApiKeyCredential(key));
- Microsoft.Extensions.AI.OpenAIChatClient openAiClient = new OpenAIChatClient(client.GetChatClient("gpt-4o-mini"));
+ //Microsoft.Extensions.AI.OpenAIChatClient openAiClient = new OpenAIChatClient(client.GetChatClient("gpt-4o-mini"));
- var chatClient = new Microsoft.Extensions.AI.FunctionInvokingChatClient(openAiClient);
+ var chatClient = new GenerativeAIChatClient(Environment.GetEnvironmentVariable("GOOGLE_API_KEY",EnvironmentVariableTarget.User));
+ //var chatClient = new Microsoft.Extensions.AI.FunctionInvokingChatClient(openAiClient);
var chatOptions = new ChatOptions();
var service = new BookStoreService();
@@ -63,6 +64,5 @@ public async Task ShouldInvokeTheBookService()
.Be(true);
Console.WriteLine(response.Text);
-
}
}
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/SnapshotTests.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/SnapshotTests.cs
index 2d1c132..0fee3a0 100755
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/SnapshotTests.cs
+++ b/src/tests/CSharpToJsonSchema.SnapshotTests/SnapshotTests.cs
@@ -3,11 +3,11 @@ namespace CSharpToJsonSchema.SnapshotTests;
[TestClass]
public class ToolTests : VerifyBase
{
- // [TestMethod]
- // public Task MethodFunction()
- // {
- // return this.CheckSourceAsync(H.Resources.MethodFunctionTools_cs.AsString());
- // }
+ [TestMethod]
+ public Task MethodFunction()
+ {
+ return this.CheckSourceAsync(H.Resources.MethodFunctionTools_cs.AsString());
+ }
[TestMethod]
public Task Weather()
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.PropertyNames.g.received.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.PropertyNames.g.received.cs
deleted file mode 100644
index c663807..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.PropertyNames.g.received.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-//HintName: ToolsJsonSerializerContext.PropertyNames.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class ToolsJsonSerializerContext
- {
- private static readonly global::System.Text.Json.JsonEncodedText PropName_input = global::System.Text.Json.JsonEncodedText.Encode("input");
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.PropertyNames.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.PropertyNames.g.verified.cs
deleted file mode 100644
index 5f28270..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.PropertyNames.g.verified.cs
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_NoReturnAsyncArgs.g.received.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_NoReturnAsyncArgs.g.received.cs
deleted file mode 100644
index c3dbe2c..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_NoReturnAsyncArgs.g.received.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//HintName: ToolsJsonSerializerContext.SampleFunctionTool_NoReturnAsyncArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class ToolsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SampleFunctionTool_NoReturnAsyncArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SampleFunctionTool_NoReturnAsyncArgs
- #nullable enable annotations
- {
- get => _SampleFunctionTool_NoReturnAsyncArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_NoReturnAsyncArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SampleFunctionTool_NoReturnAsyncArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_NoReturnAsyncArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => SampleFunctionTool_NoReturnAsyncArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_NoReturnAsyncArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = SampleFunctionTool_NoReturnAsyncArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SampleFunctionTool_NoReturnAsyncArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];
-
- var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_NoReturnAsyncArgs),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_NoReturnAsyncArgs)obj).Input,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_NoReturnAsyncArgs)obj).Input = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Input",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_NoReturnAsyncArgs).GetProperty("Input", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty(), null),
- };
-
- properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0);
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void SampleFunctionTool_NoReturnAsyncArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_NoReturnAsyncArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
- string __value_Input = ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_NoReturnAsyncArgs)value).Input;
- if (__value_Input is not null)
- {
- writer.WriteString(PropName_input, __value_Input);
- }
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_NoReturnAsyncArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_NoReturnAsyncArgs.g.verified.cs
deleted file mode 100644
index 5f28270..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_NoReturnAsyncArgs.g.verified.cs
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_NoReturnAsyncArgs.g.received.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_NoReturnAsyncArgs.g.received.cs
deleted file mode 100644
index 549a50c..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_NoReturnAsyncArgs.g.received.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//HintName: ToolsJsonSerializerContext.SampleFunctionTool_Static_NoReturnAsyncArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class ToolsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SampleFunctionTool_Static_NoReturnAsyncArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SampleFunctionTool_Static_NoReturnAsyncArgs
- #nullable enable annotations
- {
- get => _SampleFunctionTool_Static_NoReturnAsyncArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_NoReturnAsyncArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SampleFunctionTool_Static_NoReturnAsyncArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_NoReturnAsyncArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => SampleFunctionTool_Static_NoReturnAsyncArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_NoReturnAsyncArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = SampleFunctionTool_Static_NoReturnAsyncArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SampleFunctionTool_Static_NoReturnAsyncArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];
-
- var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_NoReturnAsyncArgs),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_NoReturnAsyncArgs)obj).Input,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_NoReturnAsyncArgs)obj).Input = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Input",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_NoReturnAsyncArgs).GetProperty("Input", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty(), null),
- };
-
- properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0);
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void SampleFunctionTool_Static_NoReturnAsyncArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_NoReturnAsyncArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
- string __value_Input = ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_NoReturnAsyncArgs)value).Input;
- if (__value_Input is not null)
- {
- writer.WriteString(PropName_input, __value_Input);
- }
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_NoReturnAsyncArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_NoReturnAsyncArgs.g.verified.cs
deleted file mode 100644
index 5f28270..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_NoReturnAsyncArgs.g.verified.cs
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringArgs.g.received.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringArgs.g.received.cs
deleted file mode 100644
index 0bcbc30..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringArgs.g.received.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//HintName: ToolsJsonSerializerContext.SampleFunctionTool_Static_StringArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class ToolsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SampleFunctionTool_Static_StringArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SampleFunctionTool_Static_StringArgs
- #nullable enable annotations
- {
- get => _SampleFunctionTool_Static_StringArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SampleFunctionTool_Static_StringArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => SampleFunctionTool_Static_StringArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = SampleFunctionTool_Static_StringArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SampleFunctionTool_Static_StringArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];
-
- var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringArgs),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringArgs)obj).Input,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringArgs)obj).Input = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Input",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringArgs).GetProperty("Input", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty(), null),
- };
-
- properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0);
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void SampleFunctionTool_Static_StringArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
- string __value_Input = ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringArgs)value).Input;
- if (__value_Input is not null)
- {
- writer.WriteString(PropName_input, __value_Input);
- }
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringArgs.g.verified.cs
deleted file mode 100644
index 5f28270..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringArgs.g.verified.cs
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringAsyncArgs.g.received.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringAsyncArgs.g.received.cs
deleted file mode 100644
index cb6d762..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringAsyncArgs.g.received.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//HintName: ToolsJsonSerializerContext.SampleFunctionTool_Static_StringAsyncArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class ToolsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SampleFunctionTool_Static_StringAsyncArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SampleFunctionTool_Static_StringAsyncArgs
- #nullable enable annotations
- {
- get => _SampleFunctionTool_Static_StringAsyncArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringAsyncArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SampleFunctionTool_Static_StringAsyncArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringAsyncArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => SampleFunctionTool_Static_StringAsyncArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringAsyncArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = SampleFunctionTool_Static_StringAsyncArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SampleFunctionTool_Static_StringAsyncArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];
-
- var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringAsyncArgs),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringAsyncArgs)obj).Input,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringAsyncArgs)obj).Input = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Input",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringAsyncArgs).GetProperty("Input", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty(), null),
- };
-
- properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0);
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void SampleFunctionTool_Static_StringAsyncArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringAsyncArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
- string __value_Input = ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_StringAsyncArgs)value).Input;
- if (__value_Input is not null)
- {
- writer.WriteString(PropName_input, __value_Input);
- }
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringAsyncArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringAsyncArgs.g.verified.cs
deleted file mode 100644
index 5f28270..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_StringAsyncArgs.g.verified.cs
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_VoidArgs.g.received.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_VoidArgs.g.received.cs
deleted file mode 100644
index c6d5189..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_VoidArgs.g.received.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//HintName: ToolsJsonSerializerContext.SampleFunctionTool_Static_VoidArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class ToolsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SampleFunctionTool_Static_VoidArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SampleFunctionTool_Static_VoidArgs
- #nullable enable annotations
- {
- get => _SampleFunctionTool_Static_VoidArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_VoidArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SampleFunctionTool_Static_VoidArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_VoidArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => SampleFunctionTool_Static_VoidArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_VoidArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = SampleFunctionTool_Static_VoidArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SampleFunctionTool_Static_VoidArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];
-
- var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_VoidArgs),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_VoidArgs)obj).Input,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_VoidArgs)obj).Input = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Input",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_VoidArgs).GetProperty("Input", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty(), null),
- };
-
- properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0);
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void SampleFunctionTool_Static_VoidArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_VoidArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
- string __value_Input = ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_Static_VoidArgs)value).Input;
- if (__value_Input is not null)
- {
- writer.WriteString(PropName_input, __value_Input);
- }
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_VoidArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_VoidArgs.g.verified.cs
deleted file mode 100644
index 5f28270..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_Static_VoidArgs.g.verified.cs
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringArgs.g.received.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringArgs.g.received.cs
deleted file mode 100644
index 6cf889f..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringArgs.g.received.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//HintName: ToolsJsonSerializerContext.SampleFunctionTool_StringArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class ToolsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SampleFunctionTool_StringArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SampleFunctionTool_StringArgs
- #nullable enable annotations
- {
- get => _SampleFunctionTool_StringArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SampleFunctionTool_StringArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => SampleFunctionTool_StringArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = SampleFunctionTool_StringArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SampleFunctionTool_StringArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];
-
- var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringArgs),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringArgs)obj).Input,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringArgs)obj).Input = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Input",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringArgs).GetProperty("Input", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty(), null),
- };
-
- properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0);
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void SampleFunctionTool_StringArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
- string __value_Input = ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringArgs)value).Input;
- if (__value_Input is not null)
- {
- writer.WriteString(PropName_input, __value_Input);
- }
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringArgs.g.verified.cs
deleted file mode 100644
index 5f28270..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringArgs.g.verified.cs
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringAsyncArgs.g.received.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringAsyncArgs.g.received.cs
deleted file mode 100644
index 85f49f9..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringAsyncArgs.g.received.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//HintName: ToolsJsonSerializerContext.SampleFunctionTool_StringAsyncArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class ToolsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SampleFunctionTool_StringAsyncArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SampleFunctionTool_StringAsyncArgs
- #nullable enable annotations
- {
- get => _SampleFunctionTool_StringAsyncArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringAsyncArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SampleFunctionTool_StringAsyncArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringAsyncArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => SampleFunctionTool_StringAsyncArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringAsyncArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = SampleFunctionTool_StringAsyncArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SampleFunctionTool_StringAsyncArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];
-
- var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringAsyncArgs),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringAsyncArgs)obj).Input,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringAsyncArgs)obj).Input = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Input",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringAsyncArgs).GetProperty("Input", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty(), null),
- };
-
- properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0);
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void SampleFunctionTool_StringAsyncArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringAsyncArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
- string __value_Input = ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_StringAsyncArgs)value).Input;
- if (__value_Input is not null)
- {
- writer.WriteString(PropName_input, __value_Input);
- }
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringAsyncArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringAsyncArgs.g.verified.cs
deleted file mode 100644
index 5f28270..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_StringAsyncArgs.g.verified.cs
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_VoidArgs.g.received.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_VoidArgs.g.received.cs
deleted file mode 100644
index d1985fd..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_VoidArgs.g.received.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-//HintName: ToolsJsonSerializerContext.SampleFunctionTool_VoidArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class ToolsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SampleFunctionTool_VoidArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SampleFunctionTool_VoidArgs
- #nullable enable annotations
- {
- get => _SampleFunctionTool_VoidArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_VoidArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SampleFunctionTool_VoidArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_VoidArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => SampleFunctionTool_VoidArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_VoidArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = SampleFunctionTool_VoidArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SampleFunctionTool_VoidArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];
-
- var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_VoidArgs),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_VoidArgs)obj).Input,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_VoidArgs)obj).Input = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Input",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_VoidArgs).GetProperty("Input", InstanceMemberBindingFlags, null, typeof(string), global::System.Array.Empty(), null),
- };
-
- properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0);
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void SampleFunctionTool_VoidArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_VoidArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
- string __value_Input = ((global::CSharpToJsonSchema.IntegrationTests.SampleFunctionTool_VoidArgs)value).Input;
- if (__value_Input is not null)
- {
- writer.WriteString(PropName_input, __value_Input);
- }
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_VoidArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_VoidArgs.g.verified.cs
deleted file mode 100644
index 5f28270..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.SampleFunctionTool_VoidArgs.g.verified.cs
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.String.g.received.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.String.g.received.cs
deleted file mode 100644
index 3a229f3..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.String.g.received.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//HintName: ToolsJsonSerializerContext.String.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class ToolsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _String;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo String
- #nullable enable annotations
- {
- get => _String ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(string));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_String(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.StringConverter);
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.String.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.String.g.verified.cs
deleted file mode 100644
index 5f28270..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.MethodFunction#ToolsJsonSerializerContext.String.g.verified.cs
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Boolean.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Boolean.g.verified.cs
deleted file mode 100644
index c12002c..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Boolean.g.verified.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//HintName: IVariousTypesTools.Boolean.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Boolean;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Boolean
- #nullable enable annotations
- {
- get => _Boolean ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(bool));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Boolean(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.BooleanConverter);
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Calls.generated.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Calls.generated.verified.cs
deleted file mode 100644
index 8fc213e..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Calls.generated.verified.cs
+++ /dev/null
@@ -1,383 +0,0 @@
-//HintName: IVariousTypesTools.Calls.generated.cs
-#nullable enable
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public class GetCurrentWeather3Args
- {
-
- [global::System.ComponentModel.Description("")]
- public long Parameter1 { get; set; }
- [global::System.ComponentModel.Description("")]
- public int Parameter2 { get; set; }
- [global::System.ComponentModel.Description("")]
- public double Parameter3 { get; set; }
- [global::System.ComponentModel.Description("")]
- public float Parameter4 { get; set; }
- [global::System.ComponentModel.Description("")]
- public bool Parameter5 { get; set; }
- [global::System.ComponentModel.Description("")]
- public System.DateTime DateTime { get; set; }
- [global::System.ComponentModel.Description("")]
- public System.DateOnly Date { get; set; }
- }
-
- public class SetValueArgs
- {
-
- [global::System.ComponentModel.Description("")]
- public int Value { get; set; }
- }
-
- public class GetValueArgs
- {
-
-
- }
-
- public class SetValueAsyncArgs
- {
-
- [global::System.ComponentModel.Description("")]
- public int Value { get; set; }
- }
-
- public class GetValueAsyncArgs
- {
-
-
- }
-
- public static partial class VariousTypesToolsExtensions
- {
- public static global::System.Collections.Generic.IReadOnlyDictionary>> AsCalls(this IVariousTypesTools service)
- {
- return new global::System.Collections.Generic.Dictionary>>
- {
- ["GetCurrentWeather3"] = (json, _) =>
- {
- return global::System.Threading.Tasks.Task.FromResult(service.CallGetCurrentWeather3(json));
- },
-
- ["GetValue"] = (json, _) =>
- {
- return global::System.Threading.Tasks.Task.FromResult(service.CallGetValue(json));
- },
- ["SetValue"] = (json, _) =>
- {
- service.CallSetValue(json);
-
- return global::System.Threading.Tasks.Task.FromResult(string.Empty);
- },
- ["GetValueAsync"] = async (json, cancellationToken) =>
- {
- return await service.CallGetValueAsync(json, cancellationToken);
- },
- ["SetValueAsync"] = async (json, cancellationToken) =>
- {
- await service.CallSetValueAsync(json, cancellationToken);
-
- return string.Empty;
- },
- };
- }
-
- #pragma warning disable IL2026, IL3050
- public static GetCurrentWeather3Args AsGetCurrentWeather3Args(
- this IVariousTypesTools functions,
- string json)
- {
- #if NET6_0_OR_GREATER
- if(global::System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault)
- {
-
- return global::System.Text.Json.JsonSerializer.Deserialize(json, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = {{ new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) }}
- }) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
-
- }
- else
- {
- return global::System.Text.Json.JsonSerializer.Deserialize(json, global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.GetCurrentWeather3Args) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
- }
- #else
- return
- global::System.Text.Json.JsonSerializer.Deserialize(json, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = {{ new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) }}
- }) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
- #endif
- }
- #pragma warning restore IL2026, IL3050
-
- #pragma warning disable IL2026, IL3050
- public static SetValueArgs AsSetValueArgs(
- this IVariousTypesTools functions,
- string json)
- {
- #if NET6_0_OR_GREATER
- if(global::System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault)
- {
-
- return global::System.Text.Json.JsonSerializer.Deserialize(json, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = {{ new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) }}
- }) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
-
- }
- else
- {
- return global::System.Text.Json.JsonSerializer.Deserialize(json, global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.SetValueArgs) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
- }
- #else
- return
- global::System.Text.Json.JsonSerializer.Deserialize(json, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = {{ new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) }}
- }) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
- #endif
- }
- #pragma warning restore IL2026, IL3050
-
- #pragma warning disable IL2026, IL3050
- public static GetValueArgs AsGetValueArgs(
- this IVariousTypesTools functions,
- string json)
- {
- #if NET6_0_OR_GREATER
- if(global::System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault)
- {
-
- return global::System.Text.Json.JsonSerializer.Deserialize(json, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = {{ new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) }}
- }) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
-
- }
- else
- {
- return global::System.Text.Json.JsonSerializer.Deserialize(json, global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.GetValueArgs) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
- }
- #else
- return
- global::System.Text.Json.JsonSerializer.Deserialize(json, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = {{ new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) }}
- }) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
- #endif
- }
- #pragma warning restore IL2026, IL3050
-
- #pragma warning disable IL2026, IL3050
- public static SetValueAsyncArgs AsSetValueAsyncArgs(
- this IVariousTypesTools functions,
- string json)
- {
- #if NET6_0_OR_GREATER
- if(global::System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault)
- {
-
- return global::System.Text.Json.JsonSerializer.Deserialize(json, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = {{ new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) }}
- }) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
-
- }
- else
- {
- return global::System.Text.Json.JsonSerializer.Deserialize(json, global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.SetValueAsyncArgs) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
- }
- #else
- return
- global::System.Text.Json.JsonSerializer.Deserialize(json, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = {{ new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) }}
- }) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
- #endif
- }
- #pragma warning restore IL2026, IL3050
-
- #pragma warning disable IL2026, IL3050
- public static GetValueAsyncArgs AsGetValueAsyncArgs(
- this IVariousTypesTools functions,
- string json)
- {
- #if NET6_0_OR_GREATER
- if(global::System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault)
- {
-
- return global::System.Text.Json.JsonSerializer.Deserialize(json, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = {{ new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) }}
- }) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
-
- }
- else
- {
- return global::System.Text.Json.JsonSerializer.Deserialize(json, global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.GetValueAsyncArgs) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
- }
- #else
- return
- global::System.Text.Json.JsonSerializer.Deserialize(json, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = {{ new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) }}
- }) ??
- throw new global::System.InvalidOperationException("Could not deserialize JSON.");
- #endif
- }
- #pragma warning restore IL2026, IL3050
-
- #pragma warning disable IL2026, IL3050
- public static string CallGetCurrentWeather3(this IVariousTypesTools functions, string json)
- {
- var args = functions.AsGetCurrentWeather3Args(json);
- var jsonResult = functions.GetCurrentWeather3(args.Parameter1, args.Parameter2, args.Parameter3, args.Parameter4, args.Parameter5, args.DateTime, args.Date);
-
- #if NET6_0_OR_GREATER
- if(global::System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault)
- {
-
- return global::System.Text.Json.JsonSerializer.Serialize(jsonResult, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = { new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) },
- });
-
- }
- else
- {
- return global::System.Text.Json.JsonSerializer.Serialize(jsonResult, global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.GetTypeInfo(jsonResult.GetType()));
- }
- #else
- return global::System.Text.Json.JsonSerializer.Serialize(jsonResult, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = { new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) },
- });
- #endif
- }
- #pragma warning restore IL2026, IL3050
-
- #pragma warning disable IL2026, IL3050
- public static string CallGetValue(this IVariousTypesTools functions, string json)
- {
- var args = functions.AsGetValueArgs(json);
- var jsonResult = functions.GetValue();
-
- #if NET6_0_OR_GREATER
- if(global::System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault)
- {
-
- return global::System.Text.Json.JsonSerializer.Serialize(jsonResult, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = { new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) },
- });
-
- }
- else
- {
- return global::System.Text.Json.JsonSerializer.Serialize(jsonResult, global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.GetTypeInfo(jsonResult.GetType()));
- }
- #else
- return global::System.Text.Json.JsonSerializer.Serialize(jsonResult, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = { new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) },
- });
- #endif
- }
- #pragma warning restore IL2026, IL3050
- public static void CallSetValue(this IVariousTypesTools functions, string json)
- {
- var args = functions.AsSetValueArgs(json);
- functions.SetValue(args.Value);
- }
-
- #pragma warning disable IL2026, IL3050
- public static async global::System.Threading.Tasks.Task CallGetValueAsync(
- this IVariousTypesTools functions,
- string json,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var args = functions.AsGetValueAsyncArgs(json);
- var jsonResult = await functions.GetValueAsync(cancellationToken);
-
- #if NET6_0_OR_GREATER
- if(global::System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault)
- {
-
- return global::System.Text.Json.JsonSerializer.Serialize(jsonResult, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = { new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) },
- });
- }
- else
- {
- return global::System.Text.Json.JsonSerializer.Serialize(jsonResult, global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.GetTypeInfo(jsonResult.GetType()));
- }
- #else
- return global::System.Text.Json.JsonSerializer.Serialize(jsonResult, new global::System.Text.Json.JsonSerializerOptions
- {
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- Converters = { new global::System.Text.Json.Serialization.JsonStringEnumConverter(global::System.Text.Json.JsonNamingPolicy.CamelCase) },
- });
- #endif
-
- }
- #pragma warning restore IL2026, IL3050
-
- public static async global::System.Threading.Tasks.Task CallSetValueAsync(
- this IVariousTypesTools functions,
- string json,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var args = functions.AsSetValueAsyncArgs(json);
- await functions.SetValueAsync(args.Value, cancellationToken);
-
- return string.Empty;
- }
-
- public static async global::System.Threading.Tasks.Task CallAsync(
- this IVariousTypesTools service,
- string functionName,
- string argumentsAsJson,
- global::System.Threading.CancellationToken cancellationToken = default)
- {
- var calls = service.AsCalls();
- var func = calls[functionName];
-
- return await func(argumentsAsJson, cancellationToken);
- }
- }
-
- public partial class VariousTypesToolsExtensionsJsonSerializerContext: global::System.Text.Json.Serialization.JsonSerializerContext
- {
- }
-}
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.DateOnly.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.DateOnly.g.verified.cs
deleted file mode 100644
index b10c67b..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.DateOnly.g.verified.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//HintName: IVariousTypesTools.DateOnly.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _DateOnly;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo DateOnly
- #nullable enable annotations
- {
- get => _DateOnly ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::System.DateOnly));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_DateOnly(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.DateOnlyConverter);
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.DateTime.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.DateTime.g.verified.cs
deleted file mode 100644
index 23a8cf3..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.DateTime.g.verified.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//HintName: IVariousTypesTools.DateTime.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _DateTime;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo DateTime
- #nullable enable annotations
- {
- get => _DateTime ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::System.DateTime));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_DateTime(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.DateTimeConverter);
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Double.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Double.g.verified.cs
deleted file mode 100644
index 0e044a3..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Double.g.verified.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//HintName: IVariousTypesTools.Double.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Double;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Double
- #nullable enable annotations
- {
- get => _Double ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(double));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Double(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.DoubleConverter);
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetCurrentWeather3Args.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetCurrentWeather3Args.g.verified.cs
deleted file mode 100644
index 0bf5111..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetCurrentWeather3Args.g.verified.cs
+++ /dev/null
@@ -1,219 +0,0 @@
-//HintName: IVariousTypesTools.GetCurrentWeather3Args.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _GetCurrentWeather3Args;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo GetCurrentWeather3Args
- #nullable enable annotations
- {
- get => _GetCurrentWeather3Args ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_GetCurrentWeather3Args(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => GetCurrentWeather3ArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = GetCurrentWeather3ArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] GetCurrentWeather3ArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[7];
-
- var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Parameter1,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Parameter1 = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Parameter1",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args).GetProperty("Parameter1", InstanceMemberBindingFlags, null, typeof(long), global::System.Array.Empty(), null),
- };
-
- properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0);
-
- var info1 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Parameter2,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Parameter2 = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Parameter2",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args).GetProperty("Parameter2", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty(), null),
- };
-
- properties[1] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info1);
-
- var info2 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Parameter3,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Parameter3 = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Parameter3",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args).GetProperty("Parameter3", InstanceMemberBindingFlags, null, typeof(double), global::System.Array.Empty(), null),
- };
-
- properties[2] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info2);
-
- var info3 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Parameter4,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Parameter4 = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Parameter4",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args).GetProperty("Parameter4", InstanceMemberBindingFlags, null, typeof(float), global::System.Array.Empty(), null),
- };
-
- properties[3] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info3);
-
- var info4 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Parameter5,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Parameter5 = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Parameter5",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args).GetProperty("Parameter5", InstanceMemberBindingFlags, null, typeof(bool), global::System.Array.Empty(), null),
- };
-
- properties[4] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info4);
-
- var info5 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).DateTime,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).DateTime = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "DateTime",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args).GetProperty("DateTime", InstanceMemberBindingFlags, null, typeof(global::System.DateTime), global::System.Array.Empty(), null),
- };
-
- properties[5] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info5);
-
- var info6 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Date,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)obj).Date = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Date",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args).GetProperty("Date", InstanceMemberBindingFlags, null, typeof(global::System.DateOnly), global::System.Array.Empty(), null),
- };
-
- properties[6] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info6);
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void GetCurrentWeather3ArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
- writer.WriteNumber(PropName_parameter1, ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)value).Parameter1);
- writer.WriteNumber(PropName_parameter2, ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)value).Parameter2);
- writer.WriteNumber(PropName_parameter3, ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)value).Parameter3);
- writer.WriteNumber(PropName_parameter4, ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)value).Parameter4);
- writer.WriteBoolean(PropName_parameter5, ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)value).Parameter5);
- writer.WriteString(PropName_dateTime, ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)value).DateTime);
- writer.WritePropertyName(PropName_date);
- global::System.Text.Json.JsonSerializer.Serialize(writer, ((global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args)value).Date, DateOnly);
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetJsonTypeInfo.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetJsonTypeInfo.g.verified.cs
deleted file mode 100644
index 1edd614..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetJsonTypeInfo.g.verified.cs
+++ /dev/null
@@ -1,74 +0,0 @@
-//HintName: IVariousTypesTools.GetJsonTypeInfo.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext : global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver
- {
- ///
- public override global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? GetTypeInfo(global::System.Type type)
- {
- Options.TryGetTypeInfo(type, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? typeInfo);
- return typeInfo;
- }
-
- global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? global::System.Text.Json.Serialization.Metadata.IJsonTypeInfoResolver.GetTypeInfo(global::System.Type type, global::System.Text.Json.JsonSerializerOptions options)
- {
- if (type == typeof(bool))
- {
- return Create_Boolean(options);
- }
- if (type == typeof(double))
- {
- return Create_Double(options);
- }
- if (type == typeof(float))
- {
- return Create_Single(options);
- }
- if (type == typeof(global::CSharpToJsonSchema.IntegrationTests.GetCurrentWeather3Args))
- {
- return Create_GetCurrentWeather3Args(options);
- }
- if (type == typeof(global::CSharpToJsonSchema.IntegrationTests.GetValueArgs))
- {
- return Create_GetValueArgs(options);
- }
- if (type == typeof(global::CSharpToJsonSchema.IntegrationTests.GetValueAsyncArgs))
- {
- return Create_GetValueAsyncArgs(options);
- }
- if (type == typeof(global::CSharpToJsonSchema.IntegrationTests.SetValueArgs))
- {
- return Create_SetValueArgs(options);
- }
- if (type == typeof(global::CSharpToJsonSchema.IntegrationTests.SetValueAsyncArgs))
- {
- return Create_SetValueAsyncArgs(options);
- }
- if (type == typeof(global::System.DateOnly))
- {
- return Create_DateOnly(options);
- }
- if (type == typeof(global::System.DateTime))
- {
- return Create_DateTime(options);
- }
- if (type == typeof(int))
- {
- return Create_Int32(options);
- }
- if (type == typeof(long))
- {
- return Create_Int64(options);
- }
- return null;
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetValueArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetValueArgs.g.verified.cs
deleted file mode 100644
index 32bb28a..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetValueArgs.g.verified.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//HintName: IVariousTypesTools.GetValueArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _GetValueArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo GetValueArgs
- #nullable enable annotations
- {
- get => _GetValueArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.GetValueArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_GetValueArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.GetValueArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => GetValueArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.GetValueArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = GetValueArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] GetValueArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[0];
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void GetValueArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.GetValueArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetValueAsyncArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetValueAsyncArgs.g.verified.cs
deleted file mode 100644
index 54c8114..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.GetValueAsyncArgs.g.verified.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-//HintName: IVariousTypesTools.GetValueAsyncArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _GetValueAsyncArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo GetValueAsyncArgs
- #nullable enable annotations
- {
- get => _GetValueAsyncArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.GetValueAsyncArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_GetValueAsyncArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.GetValueAsyncArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => GetValueAsyncArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.GetValueAsyncArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = GetValueAsyncArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] GetValueAsyncArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[0];
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void GetValueAsyncArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.GetValueAsyncArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Int32.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Int32.g.verified.cs
deleted file mode 100644
index 91818c8..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Int32.g.verified.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//HintName: IVariousTypesTools.Int32.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Int32;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Int32
- #nullable enable annotations
- {
- get => _Int32 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(int));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Int32(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.Int32Converter);
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Int64.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Int64.g.verified.cs
deleted file mode 100644
index 2263c42..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Int64.g.verified.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//HintName: IVariousTypesTools.Int64.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Int64;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Int64
- #nullable enable annotations
- {
- get => _Int64 ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(long));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Int64(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.Int64Converter);
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.PropertyNames.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.PropertyNames.g.verified.cs
deleted file mode 100644
index d34ba5a..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.PropertyNames.g.verified.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-//HintName: IVariousTypesTools.PropertyNames.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private static readonly global::System.Text.Json.JsonEncodedText PropName_parameter1 = global::System.Text.Json.JsonEncodedText.Encode("parameter1");
- private static readonly global::System.Text.Json.JsonEncodedText PropName_parameter2 = global::System.Text.Json.JsonEncodedText.Encode("parameter2");
- private static readonly global::System.Text.Json.JsonEncodedText PropName_parameter3 = global::System.Text.Json.JsonEncodedText.Encode("parameter3");
- private static readonly global::System.Text.Json.JsonEncodedText PropName_parameter4 = global::System.Text.Json.JsonEncodedText.Encode("parameter4");
- private static readonly global::System.Text.Json.JsonEncodedText PropName_parameter5 = global::System.Text.Json.JsonEncodedText.Encode("parameter5");
- private static readonly global::System.Text.Json.JsonEncodedText PropName_dateTime = global::System.Text.Json.JsonEncodedText.Encode("dateTime");
- private static readonly global::System.Text.Json.JsonEncodedText PropName_date = global::System.Text.Json.JsonEncodedText.Encode("date");
- private static readonly global::System.Text.Json.JsonEncodedText PropName_value = global::System.Text.Json.JsonEncodedText.Encode("value");
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.SetValueArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.SetValueArgs.g.verified.cs
deleted file mode 100644
index d83f8a2..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.SetValueArgs.g.verified.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//HintName: IVariousTypesTools.SetValueArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SetValueArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SetValueArgs
- #nullable enable annotations
- {
- get => _SetValueArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.SetValueArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SetValueArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.SetValueArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => SetValueArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SetValueArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = SetValueArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SetValueArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];
-
- var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.SetValueArgs),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.SetValueArgs)obj).Value,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.SetValueArgs)obj).Value = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Value",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SetValueArgs).GetProperty("Value", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty(), null),
- };
-
- properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0);
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void SetValueArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.SetValueArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
- writer.WriteNumber(PropName_value, ((global::CSharpToJsonSchema.IntegrationTests.SetValueArgs)value).Value);
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.SetValueAsyncArgs.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.SetValueAsyncArgs.g.verified.cs
deleted file mode 100644
index 26a1458..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.SetValueAsyncArgs.g.verified.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-//HintName: IVariousTypesTools.SetValueAsyncArgs.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _SetValueAsyncArgs;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo SetValueAsyncArgs
- #nullable enable annotations
- {
- get => _SetValueAsyncArgs ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(global::CSharpToJsonSchema.IntegrationTests.SetValueAsyncArgs));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_SetValueAsyncArgs(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- var objectInfo = new global::System.Text.Json.Serialization.Metadata.JsonObjectInfoValues
- {
- ObjectCreator = () => new global::CSharpToJsonSchema.IntegrationTests.SetValueAsyncArgs(),
- ObjectWithParameterizedConstructorCreator = null,
- PropertyMetadataInitializer = _ => SetValueAsyncArgsPropInit(options),
- ConstructorParameterMetadataInitializer = null,
- ConstructorAttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SetValueAsyncArgs).GetConstructor(InstanceMemberBindingFlags, binder: null, global::System.Array.Empty(), modifiers: null),
- SerializeHandler = SetValueAsyncArgsSerializeHandler,
- };
-
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateObjectInfo(options, objectInfo);
- jsonTypeInfo.NumberHandling = null;
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
-
- private static global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[] SetValueAsyncArgsPropInit(global::System.Text.Json.JsonSerializerOptions options)
- {
- var properties = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfo[1];
-
- var info0 = new global::System.Text.Json.Serialization.Metadata.JsonPropertyInfoValues
- {
- IsProperty = true,
- IsPublic = true,
- IsVirtual = false,
- DeclaringType = typeof(global::CSharpToJsonSchema.IntegrationTests.SetValueAsyncArgs),
- Converter = null,
- Getter = static obj => ((global::CSharpToJsonSchema.IntegrationTests.SetValueAsyncArgs)obj).Value,
- Setter = static (obj, value) => ((global::CSharpToJsonSchema.IntegrationTests.SetValueAsyncArgs)obj).Value = value!,
- IgnoreCondition = null,
- HasJsonInclude = false,
- IsExtensionData = false,
- NumberHandling = null,
- PropertyName = "Value",
- JsonPropertyName = null,
- AttributeProviderFactory = static () => typeof(global::CSharpToJsonSchema.IntegrationTests.SetValueAsyncArgs).GetProperty("Value", InstanceMemberBindingFlags, null, typeof(int), global::System.Array.Empty(), null),
- };
-
- properties[0] = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreatePropertyInfo(options, info0);
-
- return properties;
- }
-
- // Intentionally not a static method because we create a delegate to it. Invoking delegates to instance
- // methods is almost as fast as virtual calls. Static methods need to go through a shuffle thunk.
- private void SetValueAsyncArgsSerializeHandler(global::System.Text.Json.Utf8JsonWriter writer, global::CSharpToJsonSchema.IntegrationTests.SetValueAsyncArgs? value)
- {
- if (value is null)
- {
- writer.WriteNullValue();
- return;
- }
-
- writer.WriteStartObject();
-
- writer.WriteNumber(PropName_value, ((global::CSharpToJsonSchema.IntegrationTests.SetValueAsyncArgs)value).Value);
-
- writer.WriteEndObject();
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Single.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Single.g.verified.cs
deleted file mode 100644
index 60b90d8..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Single.g.verified.cs
+++ /dev/null
@@ -1,37 +0,0 @@
-//HintName: IVariousTypesTools.Single.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo? _Single;
-
- ///
- /// Defines the source generated JSON serialization contract metadata for a given type.
- ///
- #nullable disable annotations // Marking the property type as nullable-oblivious.
- public global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Single
- #nullable enable annotations
- {
- get => _Single ??= (global::System.Text.Json.Serialization.Metadata.JsonTypeInfo)Options.GetTypeInfo(typeof(float));
- }
-
- private global::System.Text.Json.Serialization.Metadata.JsonTypeInfo Create_Single(global::System.Text.Json.JsonSerializerOptions options)
- {
- if (!TryGetTypeInfoForRuntimeCustomConverter(options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo))
- {
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.SingleConverter);
- }
-
- jsonTypeInfo.OriginatingResolver = this;
- return jsonTypeInfo;
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Tools.generated.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Tools.generated.verified.cs
deleted file mode 100644
index b50de61..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.Tools.generated.verified.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-//HintName: IVariousTypesTools.Tools.generated.cs
-
-#nullable enable
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public static partial class VariousTypesToolsExtensions
- {
- public static global::System.Collections.Generic.IList AsTools(this IVariousTypesTools functions)
- {
- return new global::System.Collections.Generic.List
- {
- new global::CSharpToJsonSchema.Tool
- {
- Name = "GetCurrentWeather3",
- Description = "Get the current weather in a given location",
- Strict = false,
- Parameters = global::CSharpToJsonSchema.SchemaBuilder.ConvertToSchema(global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.GetCurrentWeather3Args,"{\"mainFunction_Desc\":\"Get the current weather in a given location\"}"),
- },
-
- new global::CSharpToJsonSchema.Tool
- {
- Name = "SetValue",
- Description = "Sets the value",
- Strict = false,
- Parameters = global::CSharpToJsonSchema.SchemaBuilder.ConvertToSchema(global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.SetValueArgs,"{\"mainFunction_Desc\":\"Sets the value\"}"),
- },
-
- new global::CSharpToJsonSchema.Tool
- {
- Name = "GetValue",
- Description = "Gets the value",
- Strict = false,
- Parameters = global::CSharpToJsonSchema.SchemaBuilder.ConvertToSchema(global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.GetValueArgs,"{\"mainFunction_Desc\":\"Gets the value\"}"),
- },
-
- new global::CSharpToJsonSchema.Tool
- {
- Name = "SetValueAsync",
- Description = "Sets the value",
- Strict = false,
- Parameters = global::CSharpToJsonSchema.SchemaBuilder.ConvertToSchema(global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.SetValueAsyncArgs,"{\"mainFunction_Desc\":\"Sets the value\"}"),
- },
-
- new global::CSharpToJsonSchema.Tool
- {
- Name = "GetValueAsync",
- Description = "Gets the value",
- Strict = false,
- Parameters = global::CSharpToJsonSchema.SchemaBuilder.ConvertToSchema(global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext.Default.GetValueAsyncArgs,"{\"mainFunction_Desc\":\"Gets the value\"}"),
- },
- };
- }
- }
-}
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.g.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.g.verified.cs
deleted file mode 100644
index 5032b6d..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes#IVariousTypesTools.g.verified.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-//HintName: IVariousTypesTools.g.cs
-//
-
-#nullable enable annotations
-#nullable disable warnings
-
-// Suppress warnings about [Obsolete] member usage in generated code.
-#pragma warning disable CS0612, CS0618
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- [global::System.CodeDom.Compiler.GeneratedCodeAttribute("CSharpToJsonSchema.Generators", "3.0.0.0")]
- public partial class VariousTypesToolsExtensionsJsonSerializerContext
- {
- private readonly static global::System.Text.Json.JsonSerializerOptions s_defaultOptions = new(global::System.Text.Json.JsonSerializerDefaults.Web)
- {
- AllowOutOfOrderMetadataProperties = true,
- AllowTrailingCommas = false,
- DefaultBufferSize = 1024,
- DefaultIgnoreCondition = global::System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingNull,
- RespectNullableAnnotations = true,
- RespectRequiredConstructorParameters = false,
- IgnoreReadOnlyFields = false,
- IgnoreReadOnlyProperties = false,
- IncludeFields = false,
- MaxDepth = 64,
- NewLine = "\n",
- NumberHandling = global::System.Text.Json.Serialization.JsonNumberHandling.Strict,
- PreferredObjectCreationHandling = global::System.Text.Json.Serialization.JsonObjectCreationHandling.Replace,
- PropertyNameCaseInsensitive = true,
- PropertyNamingPolicy = global::System.Text.Json.JsonNamingPolicy.CamelCase,
- ReadCommentHandling = global::System.Text.Json.JsonCommentHandling.Disallow,
- UnknownTypeHandling = global::System.Text.Json.Serialization.JsonUnknownTypeHandling.JsonElement,
- UnmappedMemberHandling = global::System.Text.Json.Serialization.JsonUnmappedMemberHandling.Skip,
- WriteIndented = false,
- IndentCharacter = ' ',
- IndentSize = 2,
- };
-
- private const global::System.Reflection.BindingFlags InstanceMemberBindingFlags =
- global::System.Reflection.BindingFlags.Instance |
- global::System.Reflection.BindingFlags.Public |
- global::System.Reflection.BindingFlags.NonPublic;
-
- ///
- /// The default associated with a default instance.
- ///
- public static global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext Default { get; } = new global::CSharpToJsonSchema.IntegrationTests.VariousTypesToolsExtensionsJsonSerializerContext(new global::System.Text.Json.JsonSerializerOptions(s_defaultOptions));
-
- ///
- /// The source-generated options associated with this context.
- ///
- protected override global::System.Text.Json.JsonSerializerOptions? GeneratedSerializerOptions { get; } = s_defaultOptions;
-
- ///
- public VariousTypesToolsExtensionsJsonSerializerContext() : base(null)
- {
- }
-
- ///
- public VariousTypesToolsExtensionsJsonSerializerContext(global::System.Text.Json.JsonSerializerOptions options) : base(options)
- {
- }
-
- private static bool TryGetTypeInfoForRuntimeCustomConverter(global::System.Text.Json.JsonSerializerOptions options, out global::System.Text.Json.Serialization.Metadata.JsonTypeInfo jsonTypeInfo)
- {
- global::System.Text.Json.Serialization.JsonConverter? converter = GetRuntimeConverterForType(typeof(TJsonMetadataType), options);
- if (converter != null)
- {
- jsonTypeInfo = global::System.Text.Json.Serialization.Metadata.JsonMetadataServices.CreateValueInfo(options, converter);
- return true;
- }
-
- jsonTypeInfo = null;
- return false;
- }
-
- private static global::System.Text.Json.Serialization.JsonConverter? GetRuntimeConverterForType(global::System.Type type, global::System.Text.Json.JsonSerializerOptions options)
- {
- for (int i = 0; i < options.Converters.Count; i++)
- {
- global::System.Text.Json.Serialization.JsonConverter? converter = options.Converters[i];
- if (converter?.CanConvert(type) == true)
- {
- return ExpandConverter(type, converter, options, validateCanConvert: false);
- }
- }
-
- return null;
- }
-
- private static global::System.Text.Json.Serialization.JsonConverter ExpandConverter(global::System.Type type, global::System.Text.Json.Serialization.JsonConverter converter, global::System.Text.Json.JsonSerializerOptions options, bool validateCanConvert = true)
- {
- if (validateCanConvert && !converter.CanConvert(type))
- {
- throw new global::System.InvalidOperationException(string.Format("The converter '{0}' is not compatible with the type '{1}'.", converter.GetType(), type));
- }
-
- if (converter is global::System.Text.Json.Serialization.JsonConverterFactory factory)
- {
- converter = factory.CreateConverter(type, options);
- if (converter is null || converter is global::System.Text.Json.Serialization.JsonConverterFactory)
- {
- throw new global::System.InvalidOperationException(string.Format("The converter '{0}' cannot return null or a JsonConverterFactory instance.", factory.GetType()));
- }
- }
-
- return converter;
- }
- }
-}
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes_Diagnostics.verified.txt b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes_Diagnostics.verified.txt
deleted file mode 100644
index ad47dbb..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.VariousTypes_Diagnostics.verified.txt
+++ /dev/null
@@ -1 +0,0 @@
-[]
\ No newline at end of file
diff --git a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.Weather#IWeatherTools.Calls.generated.verified.cs b/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.Weather#IWeatherTools.Calls.generated.verified.cs
deleted file mode 100644
index b8f0f13..0000000
--- a/src/tests/CSharpToJsonSchema.SnapshotTests/Snapshots/ToolTests.Weather#IWeatherTools.Calls.generated.verified.cs
+++ /dev/null
@@ -1,195 +0,0 @@
-//HintName: IWeatherTools.Calls.generated.cs
-#nullable enable
-
-namespace CSharpToJsonSchema.IntegrationTests
-{
- public class GetCurrentWeatherArgs
- {
-
- [global::System.ComponentModel.Description("The city and state, e.g. San Francisco, CA")]
- public string? Location { get; set; } = string.Empty;
- [global::System.ComponentModel.Description("")]
- public CSharpToJsonSchema.IntegrationTests.Unit Unit { get; set; }
- }
-
- public class GetCurrentWeatherAsyncArgs
- {
-
- [global::System.ComponentModel.Description("The city and state, e.g. San Francisco, CA")]
- public string? Location { get; set; } = string.Empty;
- [global::System.ComponentModel.Description("")]
- public CSharpToJsonSchema.IntegrationTests.Unit Unit { get; set; }
- }
-
- public static partial class WeatherToolsExtensions
- {
- public static global::System.Collections.Generic.IReadOnlyDictionary>> AsCalls(this IWeatherTools service)
- {
- return new global::System.Collections.Generic.Dictionary>>
- {
- ["GetCurrentWeather"] = (json, _) =>
- {
- return global::System.Threading.Tasks.Task.FromResult(service.CallGetCurrentWeather(json));
- },
-
- ["GetCurrentWeatherAsync"] = async (json, cancellationToken) =>
- {
- return await service.CallGetCurrentWeatherAsync(json, cancellationToken);
- },
-
- };
- }
-
- #pragma warning disable IL2026, IL3050
- public static GetCurrentWeatherArgs AsGetCurrentWeatherArgs(
- this IWeatherTools functions,
- string json)
- {
- #if NET6_0_OR_GREATER
- if(global::System.Text.Json.JsonSerializer.IsReflectionEnabledByDefault)
- {
-
- return global::System.Text.Json.JsonSerializer.Deserialize