diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md new file mode 100644 index 0000000000..732448d75f --- /dev/null +++ b/.github/copilot-instructions.md @@ -0,0 +1,140 @@ +# GitHub Copilot Instructions for Vogen + +This document is aimed at AI agents working on the **Vogen** repository. The +codebase is a .NET source‑generator + analyzer that wraps primitives in +strongly‑typed value objects. Understanding the structure, build/test +workflows, and project‑specific conventions will make an agent productive +quickly. + +--- + +## 🚀 High‑Level Architecture + +* **Core library** lives in `src/Vogen`. It contains the Roslyn + source‑generator and analyzer logic. Look under `Generators` for the + template code that emits structs/classes/records, and `Conversions` for the + plumbing that handles primitive conversions. +* **Code fixers** are in `src/Vogen.CodeFixers`; they plug into the validator + diagnostics produced by the analyzer. +* **Packaging** happens in `src/Vogen.Pack`; this project bundles the + analyzer/generator dlls for multiple Roslyn versions (`roslyn4.4`, + `4.6`, `4.8`, `4.11`, `4.12`) so consumers can reference the correct one. +* **Shared types** used by tests live in `src/Vogen.SharedTypes`; these are + compiled as metadata references when snapshotting across frameworks. +* **Sample/consumer apps** under `samples/*` and the `Consumers.sln` show + real‑world usage (WebApplication, OrleansExample, etc.). + +The generator is invoked during normal `dotnet build` on a project that +contains `[ValueObject]` attributes. The analyzer emits `VOG###` diagnostics to +prevent invalid construction. Codefixers offer automatic fixes. + +--- + +## 🗂 Repository Structure (key folders) + +``` +src/ ← core projects (Vogen, CodeFixers, Pack, SharedTypes) +tests/ ← unit, snapshot, analyzer and consumer tests +samples/ ← lightweight example applications +RunSnapshots.ps1← PowerShell helper for resetting/running snapshot tests +Build.ps1 ← full build-pack-test script used by CI and maintainers +CONTRIBUTING.md ← developer guidance (tests, thorough mode, etc.) +``` + +Snapshots live alongside generated code under `tests/SnapshotTests/snapshots`. +AnalyzerTests generate code in‑memory and assert diagnostics/solutions. +ConsumerTests are end‑to‑end projects that reference Vogen via NuGet (see +`Build.ps1` for how the local package is built and consumed). + +--- + +## 🛠 Developer Workflows + +1. **Quick build** – `dotnet build Vogen.sln -c Release` builds the generator, + analyzer, codefixers and tests. `Directory.Build.props` sets + `LangVersion=preview`, `TreatWarningsAsErrors`, and common suppression + flags. +2. **Snapshot tests** – run `.\RunSnapshots.ps1` from repo root. this + script cleans snapshot folders, builds with `-p Thorough=true` and runs + `dotnet test tests/SnapshotTests/SnapshotTests.csproj`. Pass + `-reset` to delete existing snapshots first. Add `-p THOROUGH` to the + build/test invocation for the full permutation set (used by CI). +3. **Analyzer tests** – `dotnet test tests/AnalyzerTests/AnalyzerTests.csproj`. + These compile generated snippets and assert diagnostics / codefixes. They + depend on `SnapshotTests` for the generated output. +4. **Consumer / sample validation** – run `Build.ps1` which: + * builds the core projects for each Roslyn version; + * packs `Vogen.Pack` into a local folder with a unique 999.X version; + * restores `Consumers.sln` using `nuget.private.config` pointing at the + local package; + * builds/tests samples and consumer tests in both Debug and Release; + * optionally rebuilds with `DefineConstants="VOGEN_NO_VALIDATION"`. +5. **Publishing** – `Build.ps1` ends by packing a release NuGet into + `./artifacts`. + +> **Note:** pull requests should include updated snapshots if the +> generator output changes; run the reset script and commit the diffs. + +--- + +## 🧪 Testing Conventions + +* Tests target multiple TFMs; snapshot project is multi‑targeted + (`net461`, `netstandard2.0`, `net8.0` …) to ensure generated code works + everywhere. The code generating the tests lives in `tests/SnapshotTests`. +* The `THOROUGH` MSBuild property expands the permutation matrix + (struct/class/record/readonly, underlying types `int`, `string`, …, + conversions, etc.). It slows down local runs; CI always sets it. +* `AnalyzerTests` use XUnit attributes and in‑memory compilation helpers + (`CompilationHelper.cs`). They also check codefixers in + `Vogen.CodeFixers`. +* `ConsumerTests` are plain projects referencing the NuGet package; they are + rebuilt by `Build.ps1` to exercise packaging scenarios. +* `tests/Testbench` contains scratch code that developers use when + experimenting; not part of CI. + +--- + +## 🔧 Project‑Specific Patterns + +* **Generator templates:** strings assembled with `$@` inside classes like + `StructGenerator`, `ClassGenerator`, `RecordStructGenerator`. Helpers in + `Util.cs` and the `Conversions` namespace produce small fragments. +* **Attribute‑driven design:** `[ValueObject]` (in the `Vogen` namespace) is + the only public API for consumers. Additional configuration comes from + `[ValueObjectConverter]`, `[ValueObjectTypeAttribute]`, etc. `GenerationParameters` + and `VoWorkItem` carry the state through the generator. +* **Roslyn versioning:** the `RoslynVersion` MSBuild property is used in + `src/Vogen/Vogen.csproj` and `Vogen.CodeFixers.csproj` to produce assemblies + that target specific engine versions – this drives the packaging logic. +* **Compile-time switches:** `VOGEN_NO_VALIDATION` disables the runtime + validation code; used in consumer tests. `THOROUGH` and + `ResetSnapshots` control test behaviours. +* **`Nullable` handling:** the generator has explicit support for nullable + underlying types (`string?`, `int?`) using helpers like + `Nullable.QuestionMarkForUnderlying` and `WrapBlock`. +* **Performance-first:** generated types are designed to be as thin as + possible; tests under `tests/Vogen.Benchmarks` validate performance. +* **Style:** the codebase is very terse and uses C#8/9/10/11 features; maintain + consistency with existing files when adding or editing generators. + +--- + +## 📌 Integration & External Dependencies + +* The only external package references in core code are Roslyn (`Microsoft.CodeAnalysis`) + and test frameworks (xUnit, FluentAssertions, etc.). +* Consumer examples depend on ASP.NET, Orleans, Refit, ServiceStack, etc. +* CI pipeline (GitHub actions) invokes `Build.ps1` and `RunSnapshots.ps1`. + +--- + +## 👀 Getting Help / Next Steps + +If a section here is unclear or you'd like more detail (e.g. typical test +patterns, how conversions are added, build script flags), let me know and I +can elaborate or add examples. + +--- + +*Last updated March 2026.* diff --git a/samples/Vogen.Examples/Types/PartialString.Json.cs b/samples/Vogen.Examples/Types/PartialString.Json.cs new file mode 100644 index 0000000000..39f27e8ba0 --- /dev/null +++ b/samples/Vogen.Examples/Types/PartialString.Json.cs @@ -0,0 +1,5 @@ +namespace Vogen.Examples.Types; + +public partial class PartialString +{ +} \ No newline at end of file diff --git a/samples/Vogen.Examples/Types/PartialString.cs b/samples/Vogen.Examples/Types/PartialString.cs new file mode 100644 index 0000000000..e75a5678a1 --- /dev/null +++ b/samples/Vogen.Examples/Types/PartialString.cs @@ -0,0 +1,7 @@ +namespace Vogen.Examples.Types; + +[ValueObject] +public partial class PartialString +{ + +} \ No newline at end of file diff --git a/samples/WebApplication/OrdersController.cs b/samples/WebApplication/OrdersController.cs index a8b254783a..fa01318bcd 100644 --- a/samples/WebApplication/OrdersController.cs +++ b/samples/WebApplication/OrdersController.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Mvc; +[ApiController] [Route("api/[controller]")] public class OrdersController : ControllerBase { @@ -32,5 +33,12 @@ public IActionResult GetByOrderId(OrderId orderId) return new NotFoundResult(); return Ok(order); } + + [HttpPost] + [Produces(typeof(Order))] + public IActionResult Post([FromBody]OrderId[] orderIds) + { + return Created(); + } } diff --git a/samples/WebApplication/Program.cs b/samples/WebApplication/Program.cs index a800bef6df..53ce3e1e4a 100644 --- a/samples/WebApplication/Program.cs +++ b/samples/WebApplication/Program.cs @@ -26,19 +26,19 @@ var builder = Microsoft.AspNetCore.Builder.WebApplication.CreateBuilder(args); +builder.Services.AddEndpointsApiExplorer(); -#if USE_MICROSOFT_OPENAPI_AND_SCALAR - builder.Services.AddOpenApi((OpenApiOptions o) => - { - o.MapVogenTypesInOpenApiMarkers(); - }); -#endif + #if USE_MICROSOFT_OPENAPI_AND_SCALAR + builder.Services.AddOpenApi((OpenApiOptions o) => + { + o.MapVogenTypesInOpenApiMarkers(); + }); + #endif #if USE_SWASHBUCKLE // Add services to the container. // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle -builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(opt => { // the following extension method is available if you specify `GenerateSwashbuckleMappingExtensionMethod` - as shown above diff --git a/samples/WebApplication/README.md b/samples/WebApplication/README.md index 17cf61fef4..32e37e5f23 100644 --- a/samples/WebApplication/README.md +++ b/samples/WebApplication/README.md @@ -11,5 +11,29 @@ You can switch by changing `` in the `.csproj` file to `MicrosoftAn or `Swashbuckle-net10`. The launch settings for `MicrosoftAndScalar` is `https openapi and scalar`. +## Run from the command line + +The `WebApplication` project uses conditional compilation constants to switch between OpenAPI setups. +Use the `OpenApiMode` MSBuild property from the command line to set those constants. + +### Run with Swashbuckle (`USE_SWASHBUCKLE`) + +```bash +dotnet run --project samples/WebApplication/WebApplication.csproj -p:OpenApiMode=Swashbuckle-net8 +``` + +```bash +dotnet run --project samples/WebApplication/WebApplication.csproj -p:OpenApiMode=Swashbuckle-net10 +``` +This will generate the swagger page at `/swagger`, and the OpenApi spec at `/swagger/v1/swagger.json` + +### Run with Microsoft OpenAPI + Scalar (`USE_MICROSOFT_OPENAPI_AND_SCALAR`) + +```bash +dotnet run --project samples/WebApplication/WebApplication.csproj -p:OpenApiMode=MicrosoftAndScalar +``` + +This will generated the OpenApi spec at `/openapi/v1.json` + The companion project to this is `WebApplicationConsumer` which demonstrates how to consume an API that uses value -object as parameters. \ No newline at end of file +object as parameters. diff --git a/samples/WebApplication/WebApplication.csproj b/samples/WebApplication/WebApplication.csproj index 2a89a94da8..6717a8e0ed 100644 --- a/samples/WebApplication/WebApplication.csproj +++ b/samples/WebApplication/WebApplication.csproj @@ -4,7 +4,7 @@ enable enable true - Swashbuckle-net8 + MicrosoftAndScalar diff --git a/src/Vogen/GenerateCodeForAspNetCoreOpenApiSchema.cs b/src/Vogen/GenerateCodeForAspNetCoreOpenApiSchema.cs index cba06acb24..2484dcd3ab 100644 --- a/src/Vogen/GenerateCodeForAspNetCoreOpenApiSchema.cs +++ b/src/Vogen/GenerateCodeForAspNetCoreOpenApiSchema.cs @@ -134,6 +134,38 @@ private static void MapWorkItemsForOpenApi(IEnumerable workItems, StringBu sb.Append(_indent, 3).AppendLine($"}}"); sb.AppendLine(); + + // array handling + sb.Append(_indent, 3).AppendLine($"if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof({typeExpression}))"); + sb.Append(_indent, 3).AppendLine("{"); + if (v is OpenApiVersionBeingUsed.One) + { + sb.Append(_indent, 4).AppendLine("schema.Type = \"array\";"); + sb.Append(_indent, 4).AppendLine($"schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema {{ Type = \"{typeAndPossibleFormat.Type}\"{(string.IsNullOrEmpty(typeAndPossibleFormat.Format) ? "" : $", Format = \"{typeAndPossibleFormat.Format}\"")} }};"); + } + if (v is OpenApiVersionBeingUsed.TwoPlus) + { + sb.Append(_indent, 4).AppendLine("schema.Type = Microsoft.OpenApi.JsonSchemaType.Array;"); + sb.Append(_indent, 4).AppendLine($"schema.Items = new Microsoft.OpenApi.OpenApiSchema {{ Type = Microsoft.OpenApi.JsonSchemaType.{typeAndPossibleFormat.JsonSchemaType}{(string.IsNullOrEmpty(typeAndPossibleFormat.Format) ? "" : $", Format = \"{typeAndPossibleFormat.Format}\"")} }};"); + } + sb.Append(_indent, 3).AppendLine("}"); + sb.AppendLine(); + + // generic collection handling (List<>, IEnumerable<>, etc.) + sb.Append(_indent, 3).AppendLine($"if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof({typeExpression}))"); + sb.Append(_indent, 3).AppendLine("{"); + if (v is OpenApiVersionBeingUsed.One) + { + sb.Append(_indent, 4).AppendLine("schema.Type = \"array\";"); + sb.Append(_indent, 4).AppendLine($"schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema {{ Type = \"{typeAndPossibleFormat.Type}\"{(string.IsNullOrEmpty(typeAndPossibleFormat.Format) ? "" : $", Format = \"{typeAndPossibleFormat.Format}\"")} }};"); + } + if (v is OpenApiVersionBeingUsed.TwoPlus) + { + sb.Append(_indent, 4).AppendLine("schema.Type = Microsoft.OpenApi.JsonSchemaType.Array;"); + sb.Append(_indent, 4).AppendLine($"schema.Items = new Microsoft.OpenApi.OpenApiSchema {{ Type = Microsoft.OpenApi.JsonSchemaType.{typeAndPossibleFormat.JsonSchemaType}{(string.IsNullOrEmpty(typeAndPossibleFormat.Format) ? "" : $", Format = \"{typeAndPossibleFormat.Format}\"")} }};"); + } + sb.Append(_indent, 3).AppendLine("}"); + sb.AppendLine(); } } diff --git a/src/Vogen/GenerateCodeForBsonSerializers.cs b/src/Vogen/GenerateCodeForBsonSerializers.cs index 6b5ddbd906..6bc63f920e 100644 --- a/src/Vogen/GenerateCodeForBsonSerializers.cs +++ b/src/Vogen/GenerateCodeForBsonSerializers.cs @@ -33,7 +33,7 @@ public static void GenerateForApplicableValueObjects(SourceProductionContext con var filename = new Filename(eachWrapper.WrapperType.ToDisplayString() + "_bson.g.cs"); - Util.TryWriteUsingUniqueFilename(filename, context, Util.FormatSource(eachGenerated)); + Util.AddSourceToContext(filename, context, Util.FormatSource(eachGenerated)); } WriteRegistration(applicableWrappers, compilation, context); @@ -84,7 +84,7 @@ private static void GenerateForMarkerClass(SourceProductionContext context, Mark string filename = Util.GetLegalFilenameForMarkerClass(markerClass.MarkerClassSymbol, ConversionMarkerKind.Bson); - Util.TryWriteUsingUniqueFilename(filename, context, Util.FormatSource(sourceCode)); + Util.AddSourceToContext(filename, context, Util.FormatSource(sourceCode)); return; @@ -163,7 +163,7 @@ public static void TryRegister() { } } """; - Util.TryWriteUsingUniqueFilename(classNameForRegistering, context, Util.FormatSource(source)); + Util.AddSourceToContext(classNameForRegistering, context, Util.FormatSource(source)); return; string ClassNameForRegistering() diff --git a/src/Vogen/GenerateCodeForEfCoreMarkers.cs b/src/Vogen/GenerateCodeForEfCoreMarkers.cs index 03a0a8bbe6..0dc776578c 100644 --- a/src/Vogen/GenerateCodeForEfCoreMarkers.cs +++ b/src/Vogen/GenerateCodeForEfCoreMarkers.cs @@ -74,7 +74,7 @@ private static void WriteEachIfNeeded(SourceProductionContext context, Conversio string filename = Util.GetLegalFilenameForMarkerClass(markerClass.MarkerClassSymbol, markerClass.VoSymbol, markerClass.Kind); - Util.TryWriteUsingUniqueFilename(filename, context, sourceText); + Util.AddSourceToContext(filename, context, sourceText); } private static void StoreExtensionMethodToRegisterAllInMarkerClass( @@ -121,7 +121,7 @@ private static void StoreExtensionMethodToRegisterAllInMarkerClass( var filename = Util.GetLegalFilenameForMarkerClass(markerSymbol, ConversionMarkerKind.EFCore); - Util.TryWriteUsingUniqueFilename(filename, context, sourceText); + Util.AddSourceToContext(filename, context, sourceText); return; diff --git a/src/Vogen/GenerateCodeForMessagePack.cs b/src/Vogen/GenerateCodeForMessagePack.cs index f58dcafb4f..7b4ba038d9 100644 --- a/src/Vogen/GenerateCodeForMessagePack.cs +++ b/src/Vogen/GenerateCodeForMessagePack.cs @@ -53,7 +53,7 @@ private static void GenerateForAMarkerClass(SourceProductionContext context, Mar string filename = Util.GetLegalFilenameForMarkerClass(markerClass.MarkerClassSymbol, ConversionMarkerKind.MessagePack); - Util.TryWriteUsingUniqueFilename(filename, context, sourceText); + Util.AddSourceToContext(filename, context, sourceText); return; @@ -124,7 +124,7 @@ public static void GenerateForApplicableValueObjects(SourceProductionContext con { SourceText sourceText = Util.FormatSource(eachToWrite.SourceCode); - Util.TryWriteUsingUniqueFilename(eachToWrite.Filename, context, sourceText); + Util.AddSourceToContext(eachToWrite.Filename, context, sourceText); } } diff --git a/src/Vogen/GenerateCodeForOpenApiSchemaCustomization.cs b/src/Vogen/GenerateCodeForOpenApiSchemaCustomization.cs index 5094ac01b6..6c200d84c9 100644 --- a/src/Vogen/GenerateCodeForOpenApiSchemaCustomization.cs +++ b/src/Vogen/GenerateCodeForOpenApiSchemaCustomization.cs @@ -209,6 +209,18 @@ private static void MapWorkItems(IEnumerable workItems, StringBuilder sb, sb.AppendLine( $$"""global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<{{fqn}}>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { {{typeText}}{{formatText}}{{nullableText}} });"""); + // also map arrays and generic collection wrappers; this keeps the + // item schema information instead of letting it default to an + // untyped array. + sb.AppendLine( + $$"""global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<{{fqn}}[]>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { {{typeText}}{{formatText}}{{nullableText}} } });""" + ); + sb.AppendLine( + $$"""global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { {{typeText}}{{formatText}}{{nullableText}} } });""" + ); + sb.AppendLine( + $$"""global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { {{typeText}}{{formatText}}{{nullableText}} } });""" + ); break; } case OpenApiVersionBeingUsed.TwoPlus: @@ -219,8 +231,19 @@ private static void MapWorkItems(IEnumerable workItems, StringBuilder sb, typeText += " | global::Microsoft.OpenApi.JsonSchemaType.Null"; } + var array = + $$"""new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { {{typeText}}{{formatText}} } }"""; sb.AppendLine( $$"""global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<{{fqn}}>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { {{typeText}}{{formatText}} });"""); + sb.AppendLine( + $$"""global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<{{fqn}}[]>(o, () => {{array}});""" + ); + sb.AppendLine( + $$"""global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => {{array}});""" + ); + sb.AppendLine( + $$"""global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => {{array}});""" + ); break; } } diff --git a/src/Vogen/GenerateCodeForOrleansSerializers.cs b/src/Vogen/GenerateCodeForOrleansSerializers.cs index e3b8053103..b2ba428125 100644 --- a/src/Vogen/GenerateCodeForOrleansSerializers.cs +++ b/src/Vogen/GenerateCodeForOrleansSerializers.cs @@ -24,7 +24,7 @@ private static void WriteSerializer(SerializerEntry entry, SourceProductionConte { SourceText sourceText = SourceText.From(entry.SourceCode, Encoding.UTF8); - Util.TryWriteUsingUniqueFilename(entry.Filename, context, sourceText); + Util.AddSourceToContext(entry.Filename, context, sourceText); } public record SerializerEntry(string Filename, string SourceCode); diff --git a/src/Vogen/Util.cs b/src/Vogen/Util.cs index 2d0dcd9c45..e6cb973ea0 100644 --- a/src/Vogen/Util.cs +++ b/src/Vogen/Util.cs @@ -1,5 +1,4 @@ -using System; -using System.Runtime.CompilerServices; +using System.Runtime.CompilerServices; using System.Text; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp; @@ -65,7 +64,7 @@ public static string EscapeTypeNameForTripleSlashComment(string typeName) => typeName.Replace("<", "{").Replace(">", "}"); static readonly IGenerateConversion[] _conversionGenerators = - { + [ new GenerateSystemTextJsonConversions(), new GenerateNewtonsoftJsonConversions(), new GenerateTypeConverterConversions(), @@ -73,7 +72,7 @@ public static string EscapeTypeNameForTripleSlashComment(string typeName) => new GenerateEfCoreTypeConversions(), new GenerateLinqToDbConversions(), new GenerateCodeForMessagePack() - }; + ]; public static string SanitizeToALegalFilename(string input) => input.Replace('@', '_').Replace(':', '_'); @@ -86,34 +85,11 @@ public static SourceText FormatSource(string source) return SourceText.From(formatted.ToFullString(), Encoding.UTF8); } - public static void TryWriteUsingUniqueFilename(Filename filename, SourceProductionContext context, SourceText sourceText) - => TryWriteUsingUniqueFilename(filename.Value, context, sourceText); - - public static void TryWriteUsingUniqueFilename(string filename, SourceProductionContext context, SourceText sourceText) - { - int count = 0; - string hintName = filename; - - while (true) - { - try - { - context.AddSource(hintName, sourceText); - return; - } - catch (ArgumentException) - { - if (++count >= 10) - { - throw; - } - - hintName = $"{count}{filename}"; - } - } - } - + public static void AddSourceToContext(Filename filename, SourceProductionContext context, SourceText sourceText) + => AddSourceToContext(filename.Value, context, sourceText); + public static void AddSourceToContext(string filename, SourceProductionContext context, SourceText sourceText) => + context.AddSource(filename, sourceText); public static string GenerateNotNullWhenTrueAttribute() => """ @@ -193,7 +169,7 @@ public static string WriteCloseNamespace(string @namespace) return string.Empty; } - return @$"}}"; + return "}"; } /// @@ -518,7 +494,7 @@ public static string GeneratePolyTypeAttributeIfAvailable(VogenKnownSymbols know return string.Empty; } - return @" [global::PolyType.TypeShapeAttribute(Marshaler = typeof(PolyTypeMarshaler))]"; + return " [global::PolyType.TypeShapeAttribute(Marshaler = typeof(PolyTypeMarshaler))]"; } /// diff --git a/src/Vogen/VoFilter.cs b/src/Vogen/VoFilter.cs index 17cf53e52e..75942dd999 100644 --- a/src/Vogen/VoFilter.cs +++ b/src/Vogen/VoFilter.cs @@ -21,10 +21,7 @@ public static IEnumerable TryGetValueObjectAttributes(INamedTypeS { var attrs = voSymbolInformation.GetAttributes(); - return attrs.Where( - a => a.AttributeClass?.EscapedFullName() == "Vogen.ValueObjectAttribute" - || a.AttributeClass?.BaseType?.EscapedFullName() == "Vogen.ValueObjectAttribute" - || a.AttributeClass?.BaseType?.BaseType?.EscapedFullName() == "Vogen.ValueObjectAttribute"); + return attrs.Where(a => IsValueObjectAttributeType(a.AttributeClass)); } /// @@ -40,6 +37,11 @@ public static IEnumerable TryGetValueObjectAttributes(INamedTypeS var semanticModel = context.SemanticModel; + if (!HasValueObjectAttributeOnThisSyntax(voSyntaxInformation, semanticModel)) + { + return null; + } + ISymbol declaredSymbol = semanticModel.GetDeclaredSymbol(context.Node)!; var voSymbolInformation = (INamedTypeSymbol) declaredSymbol; @@ -66,4 +68,30 @@ public static bool IsTarget(SyntaxNode syntaxNode) => public static bool IsTarget(INamedTypeSymbol? voClass) => voClass is not null && TryGetValueObjectAttributes(voClass).Any(); -} \ No newline at end of file + + private static bool HasValueObjectAttributeOnThisSyntax( + TypeDeclarationSyntax typeSyntax, + SemanticModel semanticModel) + { + foreach (var list in typeSyntax.AttributeLists) + { + foreach (var attribute in list.Attributes) + { + var symbol = semanticModel.GetSymbolInfo(attribute).Symbol as IMethodSymbol; + var attributeType = symbol?.ContainingType; + + if (IsValueObjectAttributeType(attributeType)) + { + return true; + } + } + } + + return false; + } + + private static bool IsValueObjectAttributeType(INamedTypeSymbol? attributeClass) => + attributeClass?.EscapedFullName() == "Vogen.ValueObjectAttribute" + || attributeClass?.BaseType?.EscapedFullName() == "Vogen.ValueObjectAttribute" + || attributeClass?.BaseType?.BaseType?.EscapedFullName() == "Vogen.ValueObjectAttribute"; +} diff --git a/src/Vogen/WriteWorkItems.cs b/src/Vogen/WriteWorkItems.cs index 314b52327b..11943bcf19 100644 --- a/src/Vogen/WriteWorkItems.cs +++ b/src/Vogen/WriteWorkItems.cs @@ -44,7 +44,7 @@ public static void WriteVo(GenerationParameters parameters) string filename = Util.SanitizeToALegalFilename(unsanitized); - Util.TryWriteUsingUniqueFilename(filename, context, sourceText); + Util.AddSourceToContext(filename, context, sourceText); } private static IGenerateValueObjectSourceCode GetGenerator(VoWorkItem item) => diff --git a/tests/SnapshotTests/BugFixes/Bug877_DuplicatesOnPartials.cs b/tests/SnapshotTests/BugFixes/Bug877_DuplicatesOnPartials.cs new file mode 100644 index 0000000000..db37836739 --- /dev/null +++ b/tests/SnapshotTests/BugFixes/Bug877_DuplicatesOnPartials.cs @@ -0,0 +1,31 @@ +using System.Threading.Tasks; +using Vogen; + +namespace SnapshotTests.BugFixes; + +// See https://github.com/SteveDunn/Vogen/issues/877 +public class Bug877_DuplicatesOnPartials +{ + // Previously, any attribute found with an array as a parameter caused an + // InvalidCastException in Vogen and stopped the generator. + [Fact] + public async Task Test() + { + var source = """ + using System; + using System.Diagnostics; + using Vogen; + + [ValueObject(conversions: Conversions.None)] + public partial class MyVo; + + [DebuggerDisplay("any attribute used to trick Vogen into provisionally considering it as a VO")] + public partial class MyVo; + """; + + await new SnapshotRunner() + .WithSource(source) + .IgnoreInitialCompilationErrors() + .RunOnAllFrameworks(); + } +} \ No newline at end of file diff --git a/tests/SnapshotTests/BugFixes/snapshots/snap-v4.8/Bug877_DuplicatesOnPartials.Test.verified.txt b/tests/SnapshotTests/BugFixes/snapshots/snap-v4.8/Bug877_DuplicatesOnPartials.Test.verified.txt new file mode 100644 index 0000000000..e93cfd9cf3 --- /dev/null +++ b/tests/SnapshotTests/BugFixes/snapshots/snap-v4.8/Bug877_DuplicatesOnPartials.Test.verified.txt @@ -0,0 +1,527 @@ +[ +// ------------------------------------------------------------------------------ +// +// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen) +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0618 +// Suppress warnings for 'Override methods on comparable types'. +#pragma warning disable CA1036 +// Suppress Error MA0097 : A class that implements IComparable or IComparable should override comparison operators +#pragma warning disable MA0097 +// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.' +// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations. +#pragma warning disable CS8669, CS8632 +#pragma warning disable CS8604 // Possible null reference argument. + +// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' +#pragma warning disable CS1591 +// Suppress warnings about CS8767 : Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). +#pragma warning disable CS8767 +namespace generator +{ + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Vogen", "1.0.0.0")] + public class VogenTypesFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public VogenTypesFactory() + { + } + + private static readonly global::System.Collections.Generic.Dictionary> _lookup = new global::System.Collections.Generic.Dictionary> + { + }; + public override bool CanConvert(global::System.Type typeToConvert) => _lookup.ContainsKey(typeToConvert); + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter(global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) => _lookup[typeToConvert].Value; + } +} + +// ------------------------------------------------------------------------------ +// +// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen) +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0618 +// Suppress warnings for 'Override methods on comparable types'. +#pragma warning disable CA1036 +// Suppress Error MA0097 : A class that implements IComparable or IComparable should override comparison operators +#pragma warning disable MA0097 +// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.' +// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations. +#pragma warning disable CS8669, CS8632 +#pragma warning disable CS8604 // Possible null reference argument. + +// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' +#pragma warning disable CS1591 +// Suppress warnings about CS8767 : Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). +#pragma warning disable CS8767 +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Vogen", "1.0.0.0")] +[global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(MyVoDebugView))] +[global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: global::System.Int32, Value = { _value }")] +public partial class MyVo : global::System.IEquatable, global::System.IEquatable, global::System.IComparable, global::System.IComparable, global::System.IFormattable, global::System.IConvertible +{ +#if DEBUG +private readonly global::System.Diagnostics.StackTrace _stackTrace = null!; +#endif +#if !VOGEN_NO_VALIDATION + private readonly global::System.Boolean _isInitialized; +#endif + private readonly global::System.Int32 _value; + /// + /// Gets the underlying value if set, otherwise a is thrown. + /// + public global::System.Int32 Value + { + [global::System.Diagnostics.DebuggerStepThroughAttribute] + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + get + { + EnsureInitialized(); + return _value; + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public MyVo() + { +#if DEBUG + _stackTrace = new global::System.Diagnostics.StackTrace(); +#endif +#if !VOGEN_NO_VALIDATION + _isInitialized = false; +#endif + _value = default; + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute] + private MyVo(global::System.Int32 value) + { + _value = value; +#if !VOGEN_NO_VALIDATION + _isInitialized = true; +#endif + } + + /// + /// Builds an instance from the provided underlying type. + /// + /// The underlying type. + /// An instance of this type. + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static MyVo From(global::System.Int32 value) + { + return new MyVo(value); + } + + /// + /// Tries to build an instance from the provided underlying type. + /// If a normalization method is provided, it will be called. + /// If validation is provided, and it fails, false will be returned. + /// + /// The underlying type. + /// An instance of the value object. + /// True if the value object can be built, otherwise false. + public static bool TryFrom( +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + global::System.Int32 value, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)] +#endif + out MyVo vo) + { + vo = new MyVo(value); + return true; + } + + /// + /// Tries to build an instance from the provided underlying value. + /// If a normalization method is provided, it will be called. + /// If validation is provided, and it fails, an error will be returned. + /// + /// The primitive value. + /// A containing either the value object, or an error. + public static global::Vogen.ValueObjectOrError TryFrom(global::System.Int32 value) + { + return new global::Vogen.ValueObjectOrError(new MyVo(value)); + } + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] +#if VOGEN_NO_VALIDATION +#pragma warning disable CS8775 + public bool IsInitialized() => true; +#pragma warning restore CS8775 +#else + public bool IsInitialized() => _isInitialized; +#endif + // only called internally when something has been deserialized into + // its primitive type. + private static MyVo __Deserialize(global::System.Int32 value) + { + return new MyVo(value); + } + + public global::System.Boolean Equals(MyVo other) + { + if (ReferenceEquals(null, other)) + { + return false; + } + + // It's possible to create uninitialized instances via converters such as EfCore (HasDefaultValue), which call Equals. + // We treat anything uninitialized as not equal to anything, even other uninitialized instances of this type. + if (!IsInitialized() || !other.IsInitialized()) + return false; + if (ReferenceEquals(this, other)) + { + return true; + } + + return GetType() == other.GetType() && global::System.Collections.Generic.EqualityComparer.Default.Equals(Value, other.Value); + } + + public global::System.Boolean Equals(MyVo other, global::System.Collections.Generic.IEqualityComparer comparer) + { + return comparer.Equals(this, other); + } + + public global::System.Boolean Equals(global::System.Int32 primitive) + { + return Value.Equals(primitive); + } + + public override global::System.Boolean Equals(global::System.Object obj) + { + return Equals(obj as MyVo); + } + + public static global::System.Boolean operator ==(MyVo left, MyVo right) => Equals(left, right); + public static global::System.Boolean operator !=(MyVo left, MyVo right) => !Equals(left, right); + public static global::System.Boolean operator ==(MyVo left, global::System.Int32 right) => left.Value.Equals(right); + public static global::System.Boolean operator ==(global::System.Int32 left, MyVo right) => right.Value.Equals(left); + public static global::System.Boolean operator !=(global::System.Int32 left, MyVo right) => !(left == right); + public static global::System.Boolean operator !=(MyVo left, global::System.Int32 right) => !(left == right); + public static explicit operator MyVo(global::System.Int32 value) => From(value); + public static explicit operator global::System.Int32(MyVo value) => value.Value; + public int CompareTo(MyVo other) + { + if (other is null) + return 1; + return Value.CompareTo(other.Value); + } + + public int CompareTo(object other) + { + if (other is null) + return 1; + if (other is MyVo x) + return CompareTo(x); + ThrowHelper.ThrowArgumentException("Cannot compare to object as it is not of type MyVo", nameof(other)); + return 0; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(string s, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(string s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, style, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s) + { + var r = global::System.Int32.Parse(s); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s, global::System.Globalization.NumberStyles style) + { + var r = global::System.Int32.Parse(s, style); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(s, provider); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(s, style, provider); + return From(r); + } + +#nullable disable + /// + [System.Security.SecuritySafeCriticalAttribute] + public string ToString(string format, global::System.IFormatProvider provider) + { + return IsInitialized() ? Value.ToString(format, provider) : "[UNINITIALIZED]"; + } + +#nullable restore +#nullable disable + /// + public System.TypeCode GetTypeCode() + { + return IsInitialized() ? Value.GetTypeCode() : default; + } + + /// + bool System.IConvertible.ToBoolean(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToBoolean(provider) : default; + } + + /// + char System.IConvertible.ToChar(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToChar(provider) : default; + } + + /// + sbyte System.IConvertible.ToSByte(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToSByte(provider) : default; + } + + /// + byte System.IConvertible.ToByte(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToByte(provider) : default; + } + + /// + short System.IConvertible.ToInt16(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt16(provider) : default; + } + + /// + ushort System.IConvertible.ToUInt16(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt16(provider) : default; + } + + /// + int System.IConvertible.ToInt32(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt32(provider) : default; + } + + /// + uint System.IConvertible.ToUInt32(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt32(provider) : default; + } + + /// + long System.IConvertible.ToInt64(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt64(provider) : default; + } + + /// + ulong System.IConvertible.ToUInt64(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt64(provider) : default; + } + + /// + float System.IConvertible.ToSingle(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToSingle(provider) : default; + } + + /// + double System.IConvertible.ToDouble(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDouble(provider) : default; + } + + /// + decimal System.IConvertible.ToDecimal(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDecimal(provider) : default; + } + + /// + System.DateTime System.IConvertible.ToDateTime(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDateTime(provider) : default; + } + + /// + object System.IConvertible.ToType(global::System.Type @type, global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToType(@type, provider) : default; + } + +#nullable restore + public override global::System.Int32 GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + global::System.Int32 hash = (global::System.Int32)2166136261; + hash = (hash * 16777619) ^ GetType().GetHashCode(); + hash = (hash * 16777619) ^ global::System.Collections.Generic.EqualityComparer.Default.GetHashCode(Value); + return hash; + } + } + + /// + public override global::System.String ToString() => IsInitialized() ? Value.ToString() ?? "" : "[UNINITIALIZED]"; + /// + public global::System.String ToString(string format) => IsInitialized() ? Value.ToString(format) ?? "" : "[UNINITIALIZED]"; + /// + public global::System.String ToString(global::System.IFormatProvider provider) => IsInitialized() ? Value.ToString(provider) ?? "" : "[UNINITIALIZED]"; + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private void EnsureInitialized() + { + if (!IsInitialized()) + { +#if DEBUG + ThrowHelper.ThrowWhenNotInitialized(_stackTrace); +#else + ThrowHelper.ThrowWhenNotInitialized(); +#endif + } + } + + internal sealed class MyVoDebugView + { + private readonly MyVo _t; + MyVoDebugView(MyVo t) + { + _t = t; + } + + public global::System.String UnderlyingType => "global::System.Int32"; + public global::System.Int32 Value => _t.Value; + public global::System.String Conversions => @""; + } + + static class ThrowHelper + { +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowInvalidOperationException(string message) => throw new global::System.InvalidOperationException(message); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowArgumentException(string message, string arg) => throw new global::System.ArgumentException(message, arg); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenCreatedWithNull() => throw CreateCannotBeNullException(); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenNotInitialized() => throw CreateValidationException("Use of uninitialized Value Object."); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenNotInitialized(global::System.Diagnostics.StackTrace stackTrace) => throw CreateValidationException("Use of uninitialized Value Object at: " + stackTrace ?? ""); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenValidationFails(global::Vogen.Validation validation) + { + throw CreateValidationException(validation); + } + + internal static global::System.Exception CreateValidationException(string message) => new global::Vogen.ValueObjectValidationException(message); + internal static global::System.Exception CreateCannotBeNullException() => new global::Vogen.ValueObjectValidationException("Cannot create a value object with null."); + internal static global::System.Exception CreateValidationException(global::Vogen.Validation validation) + { + var ex = CreateValidationException(validation.ErrorMessage); + if (validation.Data != null) + { + foreach (var kvp in validation.Data) + { + ex.Data[kvp.Key] = kvp.Value; + } + } + + return ex; + } + } +} +] \ No newline at end of file diff --git a/tests/SnapshotTests/BugFixes/snapshots/snap-v8.0/Bug877_DuplicatesOnPartials.Test.verified.txt b/tests/SnapshotTests/BugFixes/snapshots/snap-v8.0/Bug877_DuplicatesOnPartials.Test.verified.txt new file mode 100644 index 0000000000..c809e26692 --- /dev/null +++ b/tests/SnapshotTests/BugFixes/snapshots/snap-v8.0/Bug877_DuplicatesOnPartials.Test.verified.txt @@ -0,0 +1,746 @@ +[ +// ------------------------------------------------------------------------------ +// +// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen) +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0618 +// Suppress warnings for 'Override methods on comparable types'. +#pragma warning disable CA1036 +// Suppress Error MA0097 : A class that implements IComparable or IComparable should override comparison operators +#pragma warning disable MA0097 +// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.' +// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations. +#pragma warning disable CS8669, CS8632 +#pragma warning disable CS8604 // Possible null reference argument. + +// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' +#pragma warning disable CS1591 +// Suppress warnings about CS8767 : Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). +#pragma warning disable CS8767 +namespace generator +{ + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Vogen", "1.0.0.0")] + public class VogenTypesFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public VogenTypesFactory() + { + } + + private static readonly global::System.Collections.Generic.Dictionary> _lookup = new global::System.Collections.Generic.Dictionary> + { + }; + public override bool CanConvert(global::System.Type typeToConvert) => _lookup.ContainsKey(typeToConvert); + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter(global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) => _lookup[typeToConvert].Value; + } +} + +// ------------------------------------------------------------------------------ +// +// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen) +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0618 +// Suppress warnings for 'Override methods on comparable types'. +#pragma warning disable CA1036 +// Suppress Error MA0097 : A class that implements IComparable or IComparable should override comparison operators +#pragma warning disable MA0097 +// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.' +// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations. +#pragma warning disable CS8669, CS8632 +#pragma warning disable CS8604 // Possible null reference argument. + +// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' +#pragma warning disable CS1591 +// Suppress warnings about CS8767 : Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). +#pragma warning disable CS8767 +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Vogen", "1.0.0.0")] +[global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(MyVoDebugView))] +[global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: global::System.Int32, Value = { _value }")] +public partial class MyVo : global::System.IEquatable, global::System.IEquatable, global::System.IComparable, global::System.IComparable, global::System.IParsable, global::System.ISpanParsable, global::System.IUtf8SpanParsable, global::System.IFormattable, global::System.ISpanFormattable, global::System.IUtf8SpanFormattable, global::System.IConvertible +{ +#if DEBUG +private readonly global::System.Diagnostics.StackTrace _stackTrace = null!; +#endif +#if !VOGEN_NO_VALIDATION + private readonly global::System.Boolean _isInitialized; +#endif + private readonly global::System.Int32 _value; + /// + /// Gets the underlying value if set, otherwise a is thrown. + /// + public global::System.Int32 Value + { + [global::System.Diagnostics.DebuggerStepThroughAttribute] + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + get + { + EnsureInitialized(); + return _value; + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public MyVo() + { +#if DEBUG + _stackTrace = new global::System.Diagnostics.StackTrace(); +#endif +#if !VOGEN_NO_VALIDATION + _isInitialized = false; +#endif + _value = default; + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute] + private MyVo(global::System.Int32 value) + { + _value = value; +#if !VOGEN_NO_VALIDATION + _isInitialized = true; +#endif + } + + /// + /// Builds an instance from the provided underlying type. + /// + /// The underlying type. + /// An instance of this type. + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static MyVo From(global::System.Int32 value) + { + return new MyVo(value); + } + + /// + /// Tries to build an instance from the provided underlying type. + /// If a normalization method is provided, it will be called. + /// If validation is provided, and it fails, false will be returned. + /// + /// The underlying type. + /// An instance of the value object. + /// True if the value object can be built, otherwise false. + public static bool TryFrom( +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + global::System.Int32 value, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)] +#endif + out MyVo vo) + { + vo = new MyVo(value); + return true; + } + + /// + /// Tries to build an instance from the provided underlying value. + /// If a normalization method is provided, it will be called. + /// If validation is provided, and it fails, an error will be returned. + /// + /// The primitive value. + /// A containing either the value object, or an error. + public static global::Vogen.ValueObjectOrError TryFrom(global::System.Int32 value) + { + return new global::Vogen.ValueObjectOrError(new MyVo(value)); + } + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] +#if VOGEN_NO_VALIDATION +#pragma warning disable CS8775 + public bool IsInitialized() => true; +#pragma warning restore CS8775 +#else + public bool IsInitialized() => _isInitialized; +#endif + // only called internally when something has been deserialized into + // its primitive type. + private static MyVo __Deserialize(global::System.Int32 value) + { + return new MyVo(value); + } + + public global::System.Boolean Equals(MyVo other) + { + if (ReferenceEquals(null, other)) + { + return false; + } + + // It's possible to create uninitialized instances via converters such as EfCore (HasDefaultValue), which call Equals. + // We treat anything uninitialized as not equal to anything, even other uninitialized instances of this type. + if (!IsInitialized() || !other.IsInitialized()) + return false; + if (ReferenceEquals(this, other)) + { + return true; + } + + return GetType() == other.GetType() && global::System.Collections.Generic.EqualityComparer.Default.Equals(Value, other.Value); + } + + public global::System.Boolean Equals(MyVo other, global::System.Collections.Generic.IEqualityComparer comparer) + { + return comparer.Equals(this, other); + } + + public global::System.Boolean Equals(global::System.Int32 primitive) + { + return Value.Equals(primitive); + } + + public override global::System.Boolean Equals(global::System.Object obj) + { + return Equals(obj as MyVo); + } + + public static global::System.Boolean operator ==(MyVo left, MyVo right) => Equals(left, right); + public static global::System.Boolean operator !=(MyVo left, MyVo right) => !Equals(left, right); + public static global::System.Boolean operator ==(MyVo left, global::System.Int32 right) => left.Value.Equals(right); + public static global::System.Boolean operator ==(global::System.Int32 left, MyVo right) => right.Value.Equals(left); + public static global::System.Boolean operator !=(global::System.Int32 left, MyVo right) => !(left == right); + public static global::System.Boolean operator !=(MyVo left, global::System.Int32 right) => !(left == right); + public static explicit operator MyVo(global::System.Int32 value) => From(value); + public static explicit operator global::System.Int32(MyVo value) => value.Value; + public int CompareTo(MyVo other) + { + if (other is null) + return 1; + return Value.CompareTo(other.Value); + } + + public int CompareTo(object other) + { + if (other is null) + return 1; + if (other is MyVo x) + return CompareTo(x); + ThrowHelper.ThrowArgumentException("Cannot compare to object as it is not of type MyVo", nameof(other)); + return 0; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan utf8Text, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(utf8Text, style, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan utf8Text, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(utf8Text, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan utf8Text, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(utf8Text, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, style, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan s, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan s, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(string s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, style, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(string s, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(string s, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(global::System.ReadOnlySpan utf8Text, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(utf8Text, style, provider); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(global::System.ReadOnlySpan utf8Text, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(utf8Text, provider); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(global::System.ReadOnlySpan s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(s, style, provider); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(global::System.ReadOnlySpan s, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(s, provider); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s) + { + var r = global::System.Int32.Parse(s); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s, global::System.Globalization.NumberStyles style) + { + var r = global::System.Int32.Parse(s, style); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(s, style, provider); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(s, provider); + return From(r); + } + +#nullable disable + /// + public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] string format, global::System.IFormatProvider provider) + { + return IsInitialized() ? Value.ToString(format, provider) : "[UNINITIALIZED]"; + } + + /// + public bool TryFormat(global::System.Span destination, out int charsWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] global::System.ReadOnlySpan format, global::System.IFormatProvider provider) + { + charsWritten = default; + return IsInitialized() ? Value.TryFormat(destination, out charsWritten, format, provider) : true; + } + + /// + public bool TryFormat(global::System.Span utf8Destination, out int bytesWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] global::System.ReadOnlySpan format, global::System.IFormatProvider provider) + { + bytesWritten = default; + return IsInitialized() ? Value.TryFormat(utf8Destination, out bytesWritten, format, provider) : true; + } + +#nullable restore +#nullable disable + /// + public System.TypeCode GetTypeCode() + { + return IsInitialized() ? Value.GetTypeCode() : default; + } + + /// + bool System.IConvertible.ToBoolean(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToBoolean(provider) : default; + } + + /// + byte System.IConvertible.ToByte(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToByte(provider) : default; + } + + /// + char System.IConvertible.ToChar(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToChar(provider) : default; + } + + /// + System.DateTime System.IConvertible.ToDateTime(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDateTime(provider) : default; + } + + /// + decimal System.IConvertible.ToDecimal(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDecimal(provider) : default; + } + + /// + double System.IConvertible.ToDouble(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDouble(provider) : default; + } + + /// + short System.IConvertible.ToInt16(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt16(provider) : default; + } + + /// + int System.IConvertible.ToInt32(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt32(provider) : default; + } + + /// + long System.IConvertible.ToInt64(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt64(provider) : default; + } + + /// + sbyte System.IConvertible.ToSByte(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToSByte(provider) : default; + } + + /// + float System.IConvertible.ToSingle(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToSingle(provider) : default; + } + + /// + object System.IConvertible.ToType(global::System.Type @type, global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToType(@type, provider) : default; + } + + /// + ushort System.IConvertible.ToUInt16(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt16(provider) : default; + } + + /// + uint System.IConvertible.ToUInt32(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt32(provider) : default; + } + + /// + ulong System.IConvertible.ToUInt64(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt64(provider) : default; + } + +#nullable restore + public override global::System.Int32 GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + global::System.Int32 hash = (global::System.Int32)2166136261; + hash = (hash * 16777619) ^ GetType().GetHashCode(); + hash = (hash * 16777619) ^ global::System.Collections.Generic.EqualityComparer.Default.GetHashCode(Value); + return hash; + } + } + + /// + public override global::System.String ToString() => IsInitialized() ? Value.ToString() ?? "" : "[UNINITIALIZED]"; + /// + public global::System.String ToString(global::System.IFormatProvider provider) => IsInitialized() ? Value.ToString(provider) ?? "" : "[UNINITIALIZED]"; + /// + public global::System.String ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] string format) => IsInitialized() ? Value.ToString(format) ?? "" : "[UNINITIALIZED]"; + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private void EnsureInitialized() + { + if (!IsInitialized()) + { +#if DEBUG + ThrowHelper.ThrowWhenNotInitialized(_stackTrace); +#else + ThrowHelper.ThrowWhenNotInitialized(); +#endif + } + } + + internal sealed class MyVoDebugView + { + private readonly MyVo _t; + MyVoDebugView(MyVo t) + { + _t = t; + } + + public global::System.String UnderlyingType => "global::System.Int32"; + public global::System.Int32 Value => _t.Value; + public global::System.String Conversions => @""; + } + + static class ThrowHelper + { +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowInvalidOperationException(string message) => throw new global::System.InvalidOperationException(message); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowArgumentException(string message, string arg) => throw new global::System.ArgumentException(message, arg); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenCreatedWithNull() => throw CreateCannotBeNullException(); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenNotInitialized() => throw CreateValidationException("Use of uninitialized Value Object."); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenNotInitialized(global::System.Diagnostics.StackTrace stackTrace) => throw CreateValidationException("Use of uninitialized Value Object at: " + stackTrace ?? ""); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenValidationFails(global::Vogen.Validation validation) + { + throw CreateValidationException(validation); + } + + internal static global::System.Exception CreateValidationException(string message) => new global::Vogen.ValueObjectValidationException(message); + internal static global::System.Exception CreateCannotBeNullException() => new global::Vogen.ValueObjectValidationException("Cannot create a value object with null."); + internal static global::System.Exception CreateValidationException(global::Vogen.Validation validation) + { + var ex = CreateValidationException(validation.ErrorMessage); + if (validation.Data != null) + { + foreach (var kvp in validation.Data) + { + ex.Data[kvp.Key] = kvp.Value; + } + } + + return ex; + } + } +} +] \ No newline at end of file diff --git a/tests/SnapshotTests/BugFixes/snapshots/snap-v9.0/Bug810Tests.Test.verified.txt b/tests/SnapshotTests/BugFixes/snapshots/snap-v9.0/Bug810Tests.Test.verified.txt index 357ba720fa..42a5bdfdba 100644 --- a/tests/SnapshotTests/BugFixes/snapshots/snap-v9.0/Bug810Tests.Test.verified.txt +++ b/tests/SnapshotTests/BugFixes/snapshots/snap-v9.0/Bug810Tests.Test.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::N.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::N.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/BugFixes/snapshots/snap-v9.0/Bug877_DuplicatesOnPartials.Test.verified.txt b/tests/SnapshotTests/BugFixes/snapshots/snap-v9.0/Bug877_DuplicatesOnPartials.Test.verified.txt new file mode 100644 index 0000000000..c809e26692 --- /dev/null +++ b/tests/SnapshotTests/BugFixes/snapshots/snap-v9.0/Bug877_DuplicatesOnPartials.Test.verified.txt @@ -0,0 +1,746 @@ +[ +// ------------------------------------------------------------------------------ +// +// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen) +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0618 +// Suppress warnings for 'Override methods on comparable types'. +#pragma warning disable CA1036 +// Suppress Error MA0097 : A class that implements IComparable or IComparable should override comparison operators +#pragma warning disable MA0097 +// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.' +// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations. +#pragma warning disable CS8669, CS8632 +#pragma warning disable CS8604 // Possible null reference argument. + +// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' +#pragma warning disable CS1591 +// Suppress warnings about CS8767 : Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). +#pragma warning disable CS8767 +namespace generator +{ + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Vogen", "1.0.0.0")] + public class VogenTypesFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public VogenTypesFactory() + { + } + + private static readonly global::System.Collections.Generic.Dictionary> _lookup = new global::System.Collections.Generic.Dictionary> + { + }; + public override bool CanConvert(global::System.Type typeToConvert) => _lookup.ContainsKey(typeToConvert); + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter(global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) => _lookup[typeToConvert].Value; + } +} + +// ------------------------------------------------------------------------------ +// +// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen) +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0618 +// Suppress warnings for 'Override methods on comparable types'. +#pragma warning disable CA1036 +// Suppress Error MA0097 : A class that implements IComparable or IComparable should override comparison operators +#pragma warning disable MA0097 +// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.' +// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations. +#pragma warning disable CS8669, CS8632 +#pragma warning disable CS8604 // Possible null reference argument. + +// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' +#pragma warning disable CS1591 +// Suppress warnings about CS8767 : Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). +#pragma warning disable CS8767 +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Vogen", "1.0.0.0")] +[global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(MyVoDebugView))] +[global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: global::System.Int32, Value = { _value }")] +public partial class MyVo : global::System.IEquatable, global::System.IEquatable, global::System.IComparable, global::System.IComparable, global::System.IParsable, global::System.ISpanParsable, global::System.IUtf8SpanParsable, global::System.IFormattable, global::System.ISpanFormattable, global::System.IUtf8SpanFormattable, global::System.IConvertible +{ +#if DEBUG +private readonly global::System.Diagnostics.StackTrace _stackTrace = null!; +#endif +#if !VOGEN_NO_VALIDATION + private readonly global::System.Boolean _isInitialized; +#endif + private readonly global::System.Int32 _value; + /// + /// Gets the underlying value if set, otherwise a is thrown. + /// + public global::System.Int32 Value + { + [global::System.Diagnostics.DebuggerStepThroughAttribute] + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + get + { + EnsureInitialized(); + return _value; + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public MyVo() + { +#if DEBUG + _stackTrace = new global::System.Diagnostics.StackTrace(); +#endif +#if !VOGEN_NO_VALIDATION + _isInitialized = false; +#endif + _value = default; + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute] + private MyVo(global::System.Int32 value) + { + _value = value; +#if !VOGEN_NO_VALIDATION + _isInitialized = true; +#endif + } + + /// + /// Builds an instance from the provided underlying type. + /// + /// The underlying type. + /// An instance of this type. + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static MyVo From(global::System.Int32 value) + { + return new MyVo(value); + } + + /// + /// Tries to build an instance from the provided underlying type. + /// If a normalization method is provided, it will be called. + /// If validation is provided, and it fails, false will be returned. + /// + /// The underlying type. + /// An instance of the value object. + /// True if the value object can be built, otherwise false. + public static bool TryFrom( +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + global::System.Int32 value, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)] +#endif + out MyVo vo) + { + vo = new MyVo(value); + return true; + } + + /// + /// Tries to build an instance from the provided underlying value. + /// If a normalization method is provided, it will be called. + /// If validation is provided, and it fails, an error will be returned. + /// + /// The primitive value. + /// A containing either the value object, or an error. + public static global::Vogen.ValueObjectOrError TryFrom(global::System.Int32 value) + { + return new global::Vogen.ValueObjectOrError(new MyVo(value)); + } + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] +#if VOGEN_NO_VALIDATION +#pragma warning disable CS8775 + public bool IsInitialized() => true; +#pragma warning restore CS8775 +#else + public bool IsInitialized() => _isInitialized; +#endif + // only called internally when something has been deserialized into + // its primitive type. + private static MyVo __Deserialize(global::System.Int32 value) + { + return new MyVo(value); + } + + public global::System.Boolean Equals(MyVo other) + { + if (ReferenceEquals(null, other)) + { + return false; + } + + // It's possible to create uninitialized instances via converters such as EfCore (HasDefaultValue), which call Equals. + // We treat anything uninitialized as not equal to anything, even other uninitialized instances of this type. + if (!IsInitialized() || !other.IsInitialized()) + return false; + if (ReferenceEquals(this, other)) + { + return true; + } + + return GetType() == other.GetType() && global::System.Collections.Generic.EqualityComparer.Default.Equals(Value, other.Value); + } + + public global::System.Boolean Equals(MyVo other, global::System.Collections.Generic.IEqualityComparer comparer) + { + return comparer.Equals(this, other); + } + + public global::System.Boolean Equals(global::System.Int32 primitive) + { + return Value.Equals(primitive); + } + + public override global::System.Boolean Equals(global::System.Object obj) + { + return Equals(obj as MyVo); + } + + public static global::System.Boolean operator ==(MyVo left, MyVo right) => Equals(left, right); + public static global::System.Boolean operator !=(MyVo left, MyVo right) => !Equals(left, right); + public static global::System.Boolean operator ==(MyVo left, global::System.Int32 right) => left.Value.Equals(right); + public static global::System.Boolean operator ==(global::System.Int32 left, MyVo right) => right.Value.Equals(left); + public static global::System.Boolean operator !=(global::System.Int32 left, MyVo right) => !(left == right); + public static global::System.Boolean operator !=(MyVo left, global::System.Int32 right) => !(left == right); + public static explicit operator MyVo(global::System.Int32 value) => From(value); + public static explicit operator global::System.Int32(MyVo value) => value.Value; + public int CompareTo(MyVo other) + { + if (other is null) + return 1; + return Value.CompareTo(other.Value); + } + + public int CompareTo(object other) + { + if (other is null) + return 1; + if (other is MyVo x) + return CompareTo(x); + ThrowHelper.ThrowArgumentException("Cannot compare to object as it is not of type MyVo", nameof(other)); + return 0; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan utf8Text, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(utf8Text, style, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan utf8Text, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(utf8Text, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan utf8Text, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(utf8Text, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, style, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan s, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(global::System.ReadOnlySpan s, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(string s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, style, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(string s, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, provider, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// True if the value could a) be parsed by the underlying type, and b) passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse(string s, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + out MyVo result) + { + if (global::System.Int32.TryParse(s, out var __v)) + { + result = new MyVo(__v); + return true; + } + + result = default; + return false; + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(global::System.ReadOnlySpan utf8Text, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(utf8Text, style, provider); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(global::System.ReadOnlySpan utf8Text, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(utf8Text, provider); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(global::System.ReadOnlySpan s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(s, style, provider); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(global::System.ReadOnlySpan s, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(s, provider); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s) + { + var r = global::System.Int32.Parse(s); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s, global::System.Globalization.NumberStyles style) + { + var r = global::System.Int32.Parse(s, style); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s, global::System.Globalization.NumberStyles style, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(s, style, provider); + return From(r); + } + + /// + /// + /// + /// + /// The value created by calling the Parse method on the primitive. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVo Parse(string s, global::System.IFormatProvider provider) + { + var r = global::System.Int32.Parse(s, provider); + return From(r); + } + +#nullable disable + /// + public string ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] string format, global::System.IFormatProvider provider) + { + return IsInitialized() ? Value.ToString(format, provider) : "[UNINITIALIZED]"; + } + + /// + public bool TryFormat(global::System.Span destination, out int charsWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] global::System.ReadOnlySpan format, global::System.IFormatProvider provider) + { + charsWritten = default; + return IsInitialized() ? Value.TryFormat(destination, out charsWritten, format, provider) : true; + } + + /// + public bool TryFormat(global::System.Span utf8Destination, out int bytesWritten, [System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] global::System.ReadOnlySpan format, global::System.IFormatProvider provider) + { + bytesWritten = default; + return IsInitialized() ? Value.TryFormat(utf8Destination, out bytesWritten, format, provider) : true; + } + +#nullable restore +#nullable disable + /// + public System.TypeCode GetTypeCode() + { + return IsInitialized() ? Value.GetTypeCode() : default; + } + + /// + bool System.IConvertible.ToBoolean(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToBoolean(provider) : default; + } + + /// + byte System.IConvertible.ToByte(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToByte(provider) : default; + } + + /// + char System.IConvertible.ToChar(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToChar(provider) : default; + } + + /// + System.DateTime System.IConvertible.ToDateTime(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDateTime(provider) : default; + } + + /// + decimal System.IConvertible.ToDecimal(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDecimal(provider) : default; + } + + /// + double System.IConvertible.ToDouble(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDouble(provider) : default; + } + + /// + short System.IConvertible.ToInt16(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt16(provider) : default; + } + + /// + int System.IConvertible.ToInt32(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt32(provider) : default; + } + + /// + long System.IConvertible.ToInt64(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt64(provider) : default; + } + + /// + sbyte System.IConvertible.ToSByte(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToSByte(provider) : default; + } + + /// + float System.IConvertible.ToSingle(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToSingle(provider) : default; + } + + /// + object System.IConvertible.ToType(global::System.Type @type, global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToType(@type, provider) : default; + } + + /// + ushort System.IConvertible.ToUInt16(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt16(provider) : default; + } + + /// + uint System.IConvertible.ToUInt32(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt32(provider) : default; + } + + /// + ulong System.IConvertible.ToUInt64(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt64(provider) : default; + } + +#nullable restore + public override global::System.Int32 GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + global::System.Int32 hash = (global::System.Int32)2166136261; + hash = (hash * 16777619) ^ GetType().GetHashCode(); + hash = (hash * 16777619) ^ global::System.Collections.Generic.EqualityComparer.Default.GetHashCode(Value); + return hash; + } + } + + /// + public override global::System.String ToString() => IsInitialized() ? Value.ToString() ?? "" : "[UNINITIALIZED]"; + /// + public global::System.String ToString(global::System.IFormatProvider provider) => IsInitialized() ? Value.ToString(provider) ?? "" : "[UNINITIALIZED]"; + /// + public global::System.String ToString([System.Diagnostics.CodeAnalysis.StringSyntaxAttribute("NumericFormat")] string format) => IsInitialized() ? Value.ToString(format) ?? "" : "[UNINITIALIZED]"; + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private void EnsureInitialized() + { + if (!IsInitialized()) + { +#if DEBUG + ThrowHelper.ThrowWhenNotInitialized(_stackTrace); +#else + ThrowHelper.ThrowWhenNotInitialized(); +#endif + } + } + + internal sealed class MyVoDebugView + { + private readonly MyVo _t; + MyVoDebugView(MyVo t) + { + _t = t; + } + + public global::System.String UnderlyingType => "global::System.Int32"; + public global::System.Int32 Value => _t.Value; + public global::System.String Conversions => @""; + } + + static class ThrowHelper + { +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowInvalidOperationException(string message) => throw new global::System.InvalidOperationException(message); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowArgumentException(string message, string arg) => throw new global::System.ArgumentException(message, arg); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenCreatedWithNull() => throw CreateCannotBeNullException(); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenNotInitialized() => throw CreateValidationException("Use of uninitialized Value Object."); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenNotInitialized(global::System.Diagnostics.StackTrace stackTrace) => throw CreateValidationException("Use of uninitialized Value Object at: " + stackTrace ?? ""); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenValidationFails(global::Vogen.Validation validation) + { + throw CreateValidationException(validation); + } + + internal static global::System.Exception CreateValidationException(string message) => new global::Vogen.ValueObjectValidationException(message); + internal static global::System.Exception CreateCannotBeNullException() => new global::Vogen.ValueObjectValidationException("Cannot create a value object with null."); + internal static global::System.Exception CreateValidationException(global::Vogen.Validation validation) + { + var ex = CreateValidationException(validation.ErrorMessage); + if (validation.Data != null) + { + foreach (var kvp in validation.Data) + { + ex.Data[kvp.Key] = kvp.Value; + } + } + + return ex; + } + } +} +] \ No newline at end of file diff --git a/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug604_Swashbuckle_has_missing_namespaces_for_the_vo.Test.verified.txt b/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug604_Swashbuckle_has_missing_namespaces_for_the_vo.Test.verified.txt index ddd9946f44..745aed9173 100644 --- a/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug604_Swashbuckle_has_missing_namespaces_for_the_vo.Test.verified.txt +++ b/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug604_Swashbuckle_has_missing_namespaces_for_the_vo.Test.verified.txt @@ -34,7 +34,13 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType[]>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true } }); return o; diff --git a/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug608_swashbuckle_mappingTests.Used_to_treat_non_primitives_as_objects_but_now_treats_IParsable_as_strings.verified.txt b/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug608_swashbuckle_mappingTests.Used_to_treat_non_primitives_as_objects_but_now_treats_IParsable_as_strings.verified.txt index 9e821aaceb..fed77df85b 100644 --- a/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug608_swashbuckle_mappingTests.Used_to_treat_non_primitives_as_objects_but_now_treats_IParsable_as_strings.verified.txt +++ b/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug608_swashbuckle_mappingTests.Used_to_treat_non_primitives_as_objects_but_now_treats_IParsable_as_strings.verified.txt @@ -34,7 +34,13 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid", Nullable = true }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType[]>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid", Nullable = true } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid", Nullable = true } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid", Nullable = true } }); return o; diff --git a/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug610_Inconsistent_casting.Setting_implicit_casting_to_primitive_in_global_config_should_not_write_a_primitive_cast_to_wrapper.verified.txt b/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug610_Inconsistent_casting.Setting_implicit_casting_to_primitive_in_global_config_should_not_write_a_primitive_cast_to_wrapper.verified.txt index c2d23a16d7..67d8f94b31 100644 --- a/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug610_Inconsistent_casting.Setting_implicit_casting_to_primitive_in_global_config_should_not_write_a_primitive_cast_to_wrapper.verified.txt +++ b/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug610_Inconsistent_casting.Setting_implicit_casting_to_primitive_in_global_config_should_not_write_a_primitive_cast_to_wrapper.verified.txt @@ -107,7 +107,13 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType[]>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true } }); return o; diff --git a/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug720_Inconsistent_casting_mixed_with_IVogen_generation.Works_when_the_static_abstracts_and_implementation_have_same_casting.verified.txt b/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug720_Inconsistent_casting_mixed_with_IVogen_generation.Works_when_the_static_abstracts_and_implementation_have_same_casting.verified.txt index e619d118d8..a767c82aae 100644 --- a/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug720_Inconsistent_casting_mixed_with_IVogen_generation.Works_when_the_static_abstracts_and_implementation_have_same_casting.verified.txt +++ b/tests/SnapshotTests/BugFixes/snapshots/snap-vAspNetCore8.0/Bug720_Inconsistent_casting_mixed_with_IVogen_generation.Works_when_the_static_abstracts_and_implementation_have_same_casting.verified.txt @@ -107,7 +107,13 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType[]>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = true } }); return o; diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_002d5cd48fe758aa.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_002d5cd48fe758aa.verified.txt index 9b3d2c1f72..87bf3a6556 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_002d5cd48fe758aa.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_002d5cd48fe758aa.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_003d2d0cb66151e4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_003d2d0cb66151e4.verified.txt index 1a3056826a..7af4cccf71 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_003d2d0cb66151e4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_003d2d0cb66151e4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_005d0ac21fd049d7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_005d0ac21fd049d7.verified.txt index 7ce90efa45..efa2cda9f7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_005d0ac21fd049d7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_005d0ac21fd049d7.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_00e96f66fdf0ffcd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_00e96f66fdf0ffcd.verified.txt index 9b0aa60346..07fe74d587 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_00e96f66fdf0ffcd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_00e96f66fdf0ffcd.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0116620100e4fd9a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0116620100e4fd9a.verified.txt index aaff175cad..bff14c1c94 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0116620100e4fd9a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0116620100e4fd9a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_012fbd76e82e3f04.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_012fbd76e82e3f04.verified.txt index 408aadb436..bf65415aaf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_012fbd76e82e3f04.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_012fbd76e82e3f04.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_013db1f2eef4f91e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_013db1f2eef4f91e.verified.txt index 8de8958a0c..14d92d3c8c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_013db1f2eef4f91e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_013db1f2eef4f91e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_01401de07f3182bc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_01401de07f3182bc.verified.txt index 68b881077e..c6b4cb9ad1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_01401de07f3182bc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_01401de07f3182bc.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_014abf59613892a4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_014abf59613892a4.verified.txt index 9f4b2e6c98..4947a52f60 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_014abf59613892a4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_014abf59613892a4.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_023862f8a15bd7d0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_023862f8a15bd7d0.verified.txt index dafdf4cbb2..f95c53f84b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_023862f8a15bd7d0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_023862f8a15bd7d0.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0289f598fd443b1b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0289f598fd443b1b.verified.txt index 2b3fdc7630..83e9b379ca 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0289f598fd443b1b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0289f598fd443b1b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_02a550ee02020578.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_02a550ee02020578.verified.txt index cd54f7f8de..f96b545470 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_02a550ee02020578.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_02a550ee02020578.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_02e20d7371e19230.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_02e20d7371e19230.verified.txt index 99be0f0ab0..b408c93c88 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_02e20d7371e19230.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_02e20d7371e19230.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03359f6288338ab7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03359f6288338ab7.verified.txt index 7989c87b3d..449335dae6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03359f6288338ab7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03359f6288338ab7.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03822c9f0e7deb11.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03822c9f0e7deb11.verified.txt index 0f76e7169c..11b57eed60 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03822c9f0e7deb11.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03822c9f0e7deb11.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03f8e839d8e284cb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03f8e839d8e284cb.verified.txt index c6b4af6909..98eecb132d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03f8e839d8e284cb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03f8e839d8e284cb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03fc21edf421ede7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03fc21edf421ede7.verified.txt index d132d51c5d..04cb99379c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03fc21edf421ede7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_03fc21edf421ede7.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_040f1bd3bf23f4fb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_040f1bd3bf23f4fb.verified.txt index edb45d4af2..920bbef4f3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_040f1bd3bf23f4fb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_040f1bd3bf23f4fb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_042a5ffde11af2ec.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_042a5ffde11af2ec.verified.txt index 6b4eb41845..bab2f9fb65 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_042a5ffde11af2ec.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_042a5ffde11af2ec.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04677d6c7f10ed16.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04677d6c7f10ed16.verified.txt index 097d89ac8a..b91f20bf06 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04677d6c7f10ed16.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04677d6c7f10ed16.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0491737f093e26d7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0491737f093e26d7.verified.txt index c605aacff3..3e664b5c60 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0491737f093e26d7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0491737f093e26d7.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04a077b65b8f5d8b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04a077b65b8f5d8b.verified.txt index 72a339a89c..5aa689fe95 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04a077b65b8f5d8b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04a077b65b8f5d8b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04b7c83e89b12fd3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04b7c83e89b12fd3.verified.txt index b996f58e51..7c1ec6dae8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04b7c83e89b12fd3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04b7c83e89b12fd3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04ea23c5595cb8e3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04ea23c5595cb8e3.verified.txt index 6b3fbec269..7e8c60e8f9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04ea23c5595cb8e3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_04ea23c5595cb8e3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_050c26fae61c53ab.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_050c26fae61c53ab.verified.txt index af2da9f200..2823a0359a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_050c26fae61c53ab.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_050c26fae61c53ab.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0519fccfe1fe9064.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0519fccfe1fe9064.verified.txt index 49b5b9d5de..d97a580244 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0519fccfe1fe9064.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0519fccfe1fe9064.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0551d8ef7b81bc47.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0551d8ef7b81bc47.verified.txt index 2f2d6bab6f..dd10312a76 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0551d8ef7b81bc47.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0551d8ef7b81bc47.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05906f988ed23bd7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05906f988ed23bd7.verified.txt index c88ef85817..1914339d95 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05906f988ed23bd7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05906f988ed23bd7.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05a3572c175fa848.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05a3572c175fa848.verified.txt index 380ff2a8d8..2839f52965 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05a3572c175fa848.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05a3572c175fa848.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05ec053f3ab84d9f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05ec053f3ab84d9f.verified.txt index 513ecd1db0..b96aaea4ec 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05ec053f3ab84d9f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05ec053f3ab84d9f.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05eed801871b7f26.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05eed801871b7f26.verified.txt index 482b309425..5c5d45c002 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05eed801871b7f26.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05eed801871b7f26.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05ffcb611df36f9e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05ffcb611df36f9e.verified.txt index ff8535eee1..4819192b5f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05ffcb611df36f9e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_05ffcb611df36f9e.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0607d7304535f83e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0607d7304535f83e.verified.txt index affb62f2c3..bb0d8105fa 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0607d7304535f83e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0607d7304535f83e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_06321a22058a68d4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_06321a22058a68d4.verified.txt index b6e4438e3a..d990f962dd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_06321a22058a68d4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_06321a22058a68d4.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0679898d7724c514.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0679898d7724c514.verified.txt index c5f41b389a..38177a6408 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0679898d7724c514.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0679898d7724c514.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_069111ded709ffca.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_069111ded709ffca.verified.txt index b0e37532a5..614ca9e35c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_069111ded709ffca.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_069111ded709ffca.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_06a0dff89e5219f7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_06a0dff89e5219f7.verified.txt index bb84a8bd24..736f5c7f07 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_06a0dff89e5219f7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_06a0dff89e5219f7.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_07152ddef446017a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_07152ddef446017a.verified.txt index fc7cdbe326..06acbe22a3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_07152ddef446017a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_07152ddef446017a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_074a789fc2cbeb86.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_074a789fc2cbeb86.verified.txt index 98820a1c88..3b22f61539 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_074a789fc2cbeb86.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_074a789fc2cbeb86.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0785770b3467d282.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0785770b3467d282.verified.txt index c6011a187c..c06b73491f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0785770b3467d282.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0785770b3467d282.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0793e334fc6ef863.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0793e334fc6ef863.verified.txt index 31a2506ffc..3eed52a37d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0793e334fc6ef863.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0793e334fc6ef863.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0793f8891f5a59e8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0793f8891f5a59e8.verified.txt index 51464895b3..eee04f3813 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0793f8891f5a59e8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0793f8891f5a59e8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_07b2e0ae432f019d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_07b2e0ae432f019d.verified.txt index ee7c595ee7..6845cf8f99 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_07b2e0ae432f019d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_07b2e0ae432f019d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_080c2045cf96cdb6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_080c2045cf96cdb6.verified.txt index e02fcfed7c..cfd957ee15 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_080c2045cf96cdb6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_080c2045cf96cdb6.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08412de94ddea904.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08412de94ddea904.verified.txt index 1e6cdd86de..66d1f01f2f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08412de94ddea904.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08412de94ddea904.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_086efd374d152dbb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_086efd374d152dbb.verified.txt index 1da7935e4e..5e135c6e92 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_086efd374d152dbb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_086efd374d152dbb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08843b35dc20043e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08843b35dc20043e.verified.txt index 3a20304458..1545a1f04e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08843b35dc20043e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08843b35dc20043e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08b8c765370bf76f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08b8c765370bf76f.verified.txt index cc7c474add..602a1dc280 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08b8c765370bf76f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08b8c765370bf76f.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08d4579b70b3647d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08d4579b70b3647d.verified.txt index 22c9968622..21f7eab4ce 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08d4579b70b3647d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_08d4579b70b3647d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_092e0e87f53882f7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_092e0e87f53882f7.verified.txt index 0017c7d4f1..8333075d7a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_092e0e87f53882f7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_092e0e87f53882f7.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09a9f0db4d759d83.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09a9f0db4d759d83.verified.txt index 8c1b088965..dee81c3e95 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09a9f0db4d759d83.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09a9f0db4d759d83.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09b82a466b556566.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09b82a466b556566.verified.txt index 49c4594c52..a272f84f1e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09b82a466b556566.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09b82a466b556566.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09f8b32b85d23eb9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09f8b32b85d23eb9.verified.txt index d5c384908f..d7038ef265 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09f8b32b85d23eb9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_09f8b32b85d23eb9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0a52ec62740f823d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0a52ec62740f823d.verified.txt index 056d95835e..5db863d575 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0a52ec62740f823d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0a52ec62740f823d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0a77c43e358be007.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0a77c43e358be007.verified.txt index e12dd82e95..060b110097 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0a77c43e358be007.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0a77c43e358be007.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0aa57ac4252509b0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0aa57ac4252509b0.verified.txt index a2aeb0cc70..f83b39a323 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0aa57ac4252509b0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0aa57ac4252509b0.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ac0d75b00e21cb0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ac0d75b00e21cb0.verified.txt index d1c469f99f..8bf42c30c1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ac0d75b00e21cb0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ac0d75b00e21cb0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ae3931c014da994.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ae3931c014da994.verified.txt index 991c8a2235..47047b3574 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ae3931c014da994.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ae3931c014da994.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b3f34a186230f44.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b3f34a186230f44.verified.txt index 02b980dce7..3b883d7c8d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b3f34a186230f44.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b3f34a186230f44.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b5d4e46ebad4197.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b5d4e46ebad4197.verified.txt index 26269edf19..466d411ff9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b5d4e46ebad4197.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b5d4e46ebad4197.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b6e67ae1cb364fe.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b6e67ae1cb364fe.verified.txt index a0ba019bb2..3161e423b3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b6e67ae1cb364fe.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0b6e67ae1cb364fe.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ba3a6ca2f09968a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ba3a6ca2f09968a.verified.txt index 888dcdc3b9..b63dfb3bf9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ba3a6ca2f09968a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ba3a6ca2f09968a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0bf9f05aeeca580b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0bf9f05aeeca580b.verified.txt index 8beae6e9b4..321b4a85bc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0bf9f05aeeca580b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0bf9f05aeeca580b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c2e5b75af6993eb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c2e5b75af6993eb.verified.txt index 433950d493..2197e65e0b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c2e5b75af6993eb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c2e5b75af6993eb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c3cc58994dea75c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c3cc58994dea75c.verified.txt index 12eb38a6c7..adf82ca02e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c3cc58994dea75c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c3cc58994dea75c.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c8541f90aea6b2c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c8541f90aea6b2c.verified.txt index d8585cc465..b7af03c2b4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c8541f90aea6b2c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c8541f90aea6b2c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c9cc8c523e2ebea.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c9cc8c523e2ebea.verified.txt index 84f305cdca..c251316e4d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c9cc8c523e2ebea.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0c9cc8c523e2ebea.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ca4e7c909c44b49.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ca4e7c909c44b49.verified.txt index 9a01156aab..f239f149b6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ca4e7c909c44b49.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ca4e7c909c44b49.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cbed81ce9504056.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cbed81ce9504056.verified.txt index 59f867173c..35875cb99c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cbed81ce9504056.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cbed81ce9504056.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cc8450968f9655d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cc8450968f9655d.verified.txt index 17ca6328a4..34a64a7c21 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cc8450968f9655d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cc8450968f9655d.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cfb36f44b91cc38.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cfb36f44b91cc38.verified.txt index a9f6f1e153..482e6feec3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cfb36f44b91cc38.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0cfb36f44b91cc38.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0d5171e1a3727069.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0d5171e1a3727069.verified.txt index a5e28b9704..8945b48334 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0d5171e1a3727069.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0d5171e1a3727069.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0d6ee8694cdffc4c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0d6ee8694cdffc4c.verified.txt index 244f33ffe5..832fe00377 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0d6ee8694cdffc4c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0d6ee8694cdffc4c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0da638765ae76b89.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0da638765ae76b89.verified.txt index 730fdfb7dd..62201578fd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0da638765ae76b89.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0da638765ae76b89.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0dfa408cb6b487b4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0dfa408cb6b487b4.verified.txt index 9a92fd7e21..5f071a299e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0dfa408cb6b487b4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0dfa408cb6b487b4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e18d99e6a1f2348.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e18d99e6a1f2348.verified.txt index cfbbab0e80..2063672882 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e18d99e6a1f2348.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e18d99e6a1f2348.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e4957a856d8d6de.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e4957a856d8d6de.verified.txt index 9b058fcb48..703dabed6a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e4957a856d8d6de.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e4957a856d8d6de.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e52a77cc61be994.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e52a77cc61be994.verified.txt index 17037fd5f9..1a9ba79c91 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e52a77cc61be994.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e52a77cc61be994.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e7f1af3e45db09e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e7f1af3e45db09e.verified.txt index 37d64671f5..f8403cd4d5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e7f1af3e45db09e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e7f1af3e45db09e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e9f3301e1b2f672.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e9f3301e1b2f672.verified.txt index 3456ec9e15..71289a82fc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e9f3301e1b2f672.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0e9f3301e1b2f672.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0eaa64f365d9f429.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0eaa64f365d9f429.verified.txt index 222cfcfb1d..39b3776d6f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0eaa64f365d9f429.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0eaa64f365d9f429.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f297fc605923a63.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f297fc605923a63.verified.txt index 51dc945f7b..7240a76351 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f297fc605923a63.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f297fc605923a63.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f3e9268e6ca44be.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f3e9268e6ca44be.verified.txt index 53e95bd8eb..0e46b55610 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f3e9268e6ca44be.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f3e9268e6ca44be.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f69a961dd7177e4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f69a961dd7177e4.verified.txt index 798fe63687..28f897a146 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f69a961dd7177e4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0f69a961dd7177e4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ff0c1b0efdd99c4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ff0c1b0efdd99c4.verified.txt index d8b3dfe970..6237b45a67 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ff0c1b0efdd99c4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_0ff0c1b0efdd99c4.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1006547a16547362.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1006547a16547362.verified.txt index d22e021648..4788d9f115 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1006547a16547362.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1006547a16547362.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_114509b120306250.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_114509b120306250.verified.txt index 7e3dace2d1..6cdc9faf7e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_114509b120306250.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_114509b120306250.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1180bcad08db0fb5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1180bcad08db0fb5.verified.txt index d81042ea79..ac311ac850 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1180bcad08db0fb5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1180bcad08db0fb5.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_11f9ea053b544aff.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_11f9ea053b544aff.verified.txt index e259221cac..05e311cebc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_11f9ea053b544aff.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_11f9ea053b544aff.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1237a03d2bec9c92.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1237a03d2bec9c92.verified.txt index 4eb261bb2f..678d67edbb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1237a03d2bec9c92.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1237a03d2bec9c92.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_123e571821f25081.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_123e571821f25081.verified.txt index e9ad7a1708..5a3094ae71 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_123e571821f25081.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_123e571821f25081.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_128a02ef0549fe75.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_128a02ef0549fe75.verified.txt index 5de4724919..adfdec164e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_128a02ef0549fe75.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_128a02ef0549fe75.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_12925dcaca6c433b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_12925dcaca6c433b.verified.txt index c5d3bcfc9a..bae864133a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_12925dcaca6c433b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_12925dcaca6c433b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_12b2fc91218bf5c4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_12b2fc91218bf5c4.verified.txt index 412171bc60..cd14df01fc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_12b2fc91218bf5c4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_12b2fc91218bf5c4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_134f65bf8b5cb5dc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_134f65bf8b5cb5dc.verified.txt index 462ad35a49..eba7cf3242 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_134f65bf8b5cb5dc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_134f65bf8b5cb5dc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13e9e266d2f6a5e9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13e9e266d2f6a5e9.verified.txt index 27c519b631..78c42aec92 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13e9e266d2f6a5e9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13e9e266d2f6a5e9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13f5f51e3c483872.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13f5f51e3c483872.verified.txt index 280e2b1469..2dd3366b48 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13f5f51e3c483872.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13f5f51e3c483872.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13fe4c05ea4ca97c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13fe4c05ea4ca97c.verified.txt index 51c0f23cb2..d775950f6c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13fe4c05ea4ca97c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_13fe4c05ea4ca97c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14195d4389bdaec6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14195d4389bdaec6.verified.txt index aec4ba87d3..f1239cceac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14195d4389bdaec6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14195d4389bdaec6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14303f6b3e552f47.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14303f6b3e552f47.verified.txt index f7d71068e3..e2ddd5ce5e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14303f6b3e552f47.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14303f6b3e552f47.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_143071b0865c202b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_143071b0865c202b.verified.txt index d08068a54d..f314ea2881 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_143071b0865c202b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_143071b0865c202b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_145b8f8d82dca22a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_145b8f8d82dca22a.verified.txt index 20ebe4ef98..d25b731f3f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_145b8f8d82dca22a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_145b8f8d82dca22a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_147b0e6c90d98234.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_147b0e6c90d98234.verified.txt index cf987272fe..c60be68bcb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_147b0e6c90d98234.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_147b0e6c90d98234.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_148c44a1028b0928.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_148c44a1028b0928.verified.txt index b0ea0343b0..05426607e4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_148c44a1028b0928.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_148c44a1028b0928.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14dc0f676341b93f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14dc0f676341b93f.verified.txt index 1c580bc352..24f873c659 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14dc0f676341b93f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_14dc0f676341b93f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_150e1a500f327d5c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_150e1a500f327d5c.verified.txt index 58f0900786..5279e0c636 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_150e1a500f327d5c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_150e1a500f327d5c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15165ee14034943c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15165ee14034943c.verified.txt index b0eaa1de9f..9b5af12e11 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15165ee14034943c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15165ee14034943c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_153c9cc5b072b167.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_153c9cc5b072b167.verified.txt index 400f13b2d3..8fd6ad5255 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_153c9cc5b072b167.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_153c9cc5b072b167.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15680a9d68dddabc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15680a9d68dddabc.verified.txt index 7340aaf23b..a0de8213ae 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15680a9d68dddabc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15680a9d68dddabc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15a64028ce46ef19.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15a64028ce46ef19.verified.txt index 0e443d3d61..fe311c921b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15a64028ce46ef19.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15a64028ce46ef19.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15ef77dd832e2466.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15ef77dd832e2466.verified.txt index 20aad89463..769347bcd8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15ef77dd832e2466.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_15ef77dd832e2466.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1632a22c6349ee7c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1632a22c6349ee7c.verified.txt index ea397e7f58..81fc14d5ac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1632a22c6349ee7c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1632a22c6349ee7c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1645ee38b69740c7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1645ee38b69740c7.verified.txt index b528f75b89..4ab0b02104 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1645ee38b69740c7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1645ee38b69740c7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_16db51bd1e2ec030.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_16db51bd1e2ec030.verified.txt index 955fc257a3..352932ce07 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_16db51bd1e2ec030.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_16db51bd1e2ec030.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17045035b52a9e97.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17045035b52a9e97.verified.txt index 466b8adacf..3f389a40fd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17045035b52a9e97.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17045035b52a9e97.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_171b2fff6e43628b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_171b2fff6e43628b.verified.txt index 38b9e7d339..bfe9aecd54 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_171b2fff6e43628b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_171b2fff6e43628b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1771f89988907e67.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1771f89988907e67.verified.txt index 5562890ce0..8124b02d1b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1771f89988907e67.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1771f89988907e67.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17828df9ca09212a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17828df9ca09212a.verified.txt index 90296cf630..065a13ca49 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17828df9ca09212a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17828df9ca09212a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17aecd2811eb19d4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17aecd2811eb19d4.verified.txt index e4dd8b7345..7f002b8797 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17aecd2811eb19d4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17aecd2811eb19d4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17c4ed9b9d22b6a3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17c4ed9b9d22b6a3.verified.txt index 9689712d1f..3a9d741f03 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17c4ed9b9d22b6a3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17c4ed9b9d22b6a3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17f74a102a77e43e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17f74a102a77e43e.verified.txt index 966acfa756..8d09e7f272 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17f74a102a77e43e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_17f74a102a77e43e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_182258d3a7058d60.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_182258d3a7058d60.verified.txt index 35b9119f44..7de1b4c4e0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_182258d3a7058d60.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_182258d3a7058d60.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1844f4d95b814b66.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1844f4d95b814b66.verified.txt index 5b5b267f56..db21ab329a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1844f4d95b814b66.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1844f4d95b814b66.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_186d320a5776cafe.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_186d320a5776cafe.verified.txt index 8b08e37b51..32b16a8cd6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_186d320a5776cafe.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_186d320a5776cafe.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18db0facb56c1399.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18db0facb56c1399.verified.txt index 51a6269bd5..03496bcc3f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18db0facb56c1399.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18db0facb56c1399.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18f2eca141bb267a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18f2eca141bb267a.verified.txt index 67b84be06e..aa67b3217d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18f2eca141bb267a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18f2eca141bb267a.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18f873c652aac6b9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18f873c652aac6b9.verified.txt index 755b856658..3ddd37fa2f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18f873c652aac6b9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_18f873c652aac6b9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1900a16b8c80fb3c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1900a16b8c80fb3c.verified.txt index 09d12df949..c22534e67d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1900a16b8c80fb3c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1900a16b8c80fb3c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_193c2e2ffa8f0890.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_193c2e2ffa8f0890.verified.txt index 9563cf869f..2f5cfa6c81 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_193c2e2ffa8f0890.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_193c2e2ffa8f0890.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_196fb57a9e519a45.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_196fb57a9e519a45.verified.txt index 66549c11b6..b3ed396296 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_196fb57a9e519a45.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_196fb57a9e519a45.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19730e4040f30912.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19730e4040f30912.verified.txt index 3dec099f64..806b9ba102 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19730e4040f30912.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19730e4040f30912.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_199dd5c833602d61.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_199dd5c833602d61.verified.txt index 61ec821bb7..48ba56c626 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_199dd5c833602d61.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_199dd5c833602d61.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_199e53d80f5953ea.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_199e53d80f5953ea.verified.txt index 62754a0feb..a6f10a466e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_199e53d80f5953ea.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_199e53d80f5953ea.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19a0fc5e1a1214ff.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19a0fc5e1a1214ff.verified.txt index 7540c2a72e..8c215408fa 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19a0fc5e1a1214ff.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19a0fc5e1a1214ff.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19fc354a35ba2f31.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19fc354a35ba2f31.verified.txt index f0dd57fca6..507196d7f0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19fc354a35ba2f31.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_19fc354a35ba2f31.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a33fdad9019ef8c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a33fdad9019ef8c.verified.txt index c0c9060b16..f68b273637 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a33fdad9019ef8c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a33fdad9019ef8c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a8a311eb41a5103.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a8a311eb41a5103.verified.txt index 4ebe0bcf6f..467bb4359a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a8a311eb41a5103.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a8a311eb41a5103.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a9aea462c583783.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a9aea462c583783.verified.txt index 498c8e6646..2b83d39460 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a9aea462c583783.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1a9aea462c583783.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b02354eb9e85de6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b02354eb9e85de6.verified.txt index abc17c4026..ee9974540f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b02354eb9e85de6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b02354eb9e85de6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b53037f09c40944.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b53037f09c40944.verified.txt index 389e60ec1b..8d9eab0f69 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b53037f09c40944.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b53037f09c40944.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b5ede882203b8bc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b5ede882203b8bc.verified.txt index ac03987ad4..857b4dd5f2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b5ede882203b8bc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b5ede882203b8bc.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b81bad1e978483e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b81bad1e978483e.verified.txt index 09cd422a05..af5212646e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b81bad1e978483e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1b81bad1e978483e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1beffee6bc74528f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1beffee6bc74528f.verified.txt index ed28444e9e..c8f364388e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1beffee6bc74528f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1beffee6bc74528f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c177d6b1e0c8284.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c177d6b1e0c8284.verified.txt index 8532ad44df..07e705d70d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c177d6b1e0c8284.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c177d6b1e0c8284.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c6dbc2accdc3f5d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c6dbc2accdc3f5d.verified.txt index 72fec5ca15..2568e6149a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c6dbc2accdc3f5d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c6dbc2accdc3f5d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c8865781948d226.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c8865781948d226.verified.txt index 10bbfd7b71..e87e4ef722 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c8865781948d226.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1c8865781948d226.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ca9311064bc1f6f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ca9311064bc1f6f.verified.txt index dd6e23a44b..a988dc23fc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ca9311064bc1f6f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ca9311064bc1f6f.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1cbd715b0cfbd2da.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1cbd715b0cfbd2da.verified.txt index bd7b68a9b8..16bf1f2a4b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1cbd715b0cfbd2da.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1cbd715b0cfbd2da.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ce1eabdbaee8704.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ce1eabdbaee8704.verified.txt index abb42ab0a8..6a882b0d81 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ce1eabdbaee8704.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ce1eabdbaee8704.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1d36007a9b4243f6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1d36007a9b4243f6.verified.txt index 0c4fb06f26..e5c38b3eaf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1d36007a9b4243f6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1d36007a9b4243f6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1d5fac774b696c4a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1d5fac774b696c4a.verified.txt index d0bf4e5cf2..03a5640cd6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1d5fac774b696c4a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1d5fac774b696c4a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1db349b21f4c3a16.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1db349b21f4c3a16.verified.txt index 440f851327..b3cca669f3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1db349b21f4c3a16.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1db349b21f4c3a16.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ddd033b86aecbcf.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ddd033b86aecbcf.verified.txt index a78823cba9..83aebce645 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ddd033b86aecbcf.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ddd033b86aecbcf.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e0b1c90ff000478.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e0b1c90ff000478.verified.txt index 2954f80309..f9194954cb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e0b1c90ff000478.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e0b1c90ff000478.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e459c5e4a6c783e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e459c5e4a6c783e.verified.txt index b10fe0cf17..af7434db53 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e459c5e4a6c783e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e459c5e4a6c783e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e6e87b2bbce0cec.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e6e87b2bbce0cec.verified.txt index 903a7a9c73..3fcd6b7a53 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e6e87b2bbce0cec.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e6e87b2bbce0cec.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e8225ee5daa3e10.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e8225ee5daa3e10.verified.txt index e358b86548..67f87a9728 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e8225ee5daa3e10.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1e8225ee5daa3e10.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ea649ddc12d2ad0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ea649ddc12d2ad0.verified.txt index 1d8158ffb7..269b347bdc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ea649ddc12d2ad0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1ea649ddc12d2ad0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1eb929855afe3275.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1eb929855afe3275.verified.txt index 3c6c799e71..f78f5f76ad 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1eb929855afe3275.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1eb929855afe3275.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1f1c799434426d5a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1f1c799434426d5a.verified.txt index 8a74c3e198..302145c644 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1f1c799434426d5a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1f1c799434426d5a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1f8a564b588cd2a3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1f8a564b588cd2a3.verified.txt index 71bdec9531..f6839f3647 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1f8a564b588cd2a3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1f8a564b588cd2a3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1fee4120bb9d2612.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1fee4120bb9d2612.verified.txt index a50f8e0c42..b47f73d902 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1fee4120bb9d2612.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_1fee4120bb9d2612.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20039b8285b3422b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20039b8285b3422b.verified.txt index b9e5220f77..74fd16fd08 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20039b8285b3422b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20039b8285b3422b.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20275015aea2f4cf.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20275015aea2f4cf.verified.txt index a53d71598f..dc3d0aa89e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20275015aea2f4cf.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20275015aea2f4cf.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2047df92b15f26ac.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2047df92b15f26ac.verified.txt index dcf359cec5..64635dc37b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2047df92b15f26ac.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2047df92b15f26ac.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2056840d5f5891ef.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2056840d5f5891ef.verified.txt index ab14e5b2f8..126b67c2f5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2056840d5f5891ef.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2056840d5f5891ef.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_207ab1271e0cb6ff.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_207ab1271e0cb6ff.verified.txt index 5fe9da5e00..8286c2cce2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_207ab1271e0cb6ff.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_207ab1271e0cb6ff.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_208ce209b700183f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_208ce209b700183f.verified.txt index e7e63e01c3..a574cc3fac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_208ce209b700183f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_208ce209b700183f.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20951901d0e8cf1f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20951901d0e8cf1f.verified.txt index e9e82ac6e5..a85fecb99f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20951901d0e8cf1f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20951901d0e8cf1f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20a2cae75d85684f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20a2cae75d85684f.verified.txt index f0478e10f0..a8f598a071 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20a2cae75d85684f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_20a2cae75d85684f.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_213191bfdaf92b61.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_213191bfdaf92b61.verified.txt index 6fce697af5..541abf8b47 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_213191bfdaf92b61.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_213191bfdaf92b61.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_215fd6848e5070ac.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_215fd6848e5070ac.verified.txt index 19e5189b57..4bb7c80d53 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_215fd6848e5070ac.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_215fd6848e5070ac.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21942cf39e1218a1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21942cf39e1218a1.verified.txt index 990043a2c4..1058fb6521 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21942cf39e1218a1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21942cf39e1218a1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21be4882bdc170f6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21be4882bdc170f6.verified.txt index 202800abfa..96d7cc326d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21be4882bdc170f6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21be4882bdc170f6.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21c26092f827f96f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21c26092f827f96f.verified.txt index 5fa389c4cc..5b8d233c12 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21c26092f827f96f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21c26092f827f96f.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21d03f7364f0bc0c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21d03f7364f0bc0c.verified.txt index 8da996b3d2..3778acaf72 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21d03f7364f0bc0c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21d03f7364f0bc0c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21d7861cdbb4fcc7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21d7861cdbb4fcc7.verified.txt index 1b0400f800..29fbba31e1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21d7861cdbb4fcc7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_21d7861cdbb4fcc7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_228316522d7b41b7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_228316522d7b41b7.verified.txt index 8e0bf0de9a..023849734a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_228316522d7b41b7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_228316522d7b41b7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22af69314c41f8ed.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22af69314c41f8ed.verified.txt index 2b3025c513..eb12f244b6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22af69314c41f8ed.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22af69314c41f8ed.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22e8a7a673050219.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22e8a7a673050219.verified.txt index 75ee2c320d..52aaf8da30 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22e8a7a673050219.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22e8a7a673050219.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22f2fddf8bd7e38c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22f2fddf8bd7e38c.verified.txt index dfdb288a41..c267b0a669 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22f2fddf8bd7e38c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_22f2fddf8bd7e38c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_235169cd793f8073.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_235169cd793f8073.verified.txt index 21bb227fa2..e3eb6856b6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_235169cd793f8073.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_235169cd793f8073.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23992e2bea0c70dc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23992e2bea0c70dc.verified.txt index 553b6c04e2..1069049fb9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23992e2bea0c70dc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23992e2bea0c70dc.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23a78fbb58104c8d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23a78fbb58104c8d.verified.txt index 7916e32246..071387edf6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23a78fbb58104c8d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23a78fbb58104c8d.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23c7cba46cbcf30a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23c7cba46cbcf30a.verified.txt index 5840a1c467..490f3b42d4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23c7cba46cbcf30a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23c7cba46cbcf30a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23f02e762c0600f3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23f02e762c0600f3.verified.txt index 5c90e91602..d36434dfe0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23f02e762c0600f3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_23f02e762c0600f3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_244d9b94808741a9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_244d9b94808741a9.verified.txt index 46109c19a6..f0c3ce04fd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_244d9b94808741a9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_244d9b94808741a9.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_247a2c57ff814a0f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_247a2c57ff814a0f.verified.txt index ea00631a7e..ae21fbdb56 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_247a2c57ff814a0f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_247a2c57ff814a0f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_24fabee9d1e663a9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_24fabee9d1e663a9.verified.txt index bb68f252f8..c486621955 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_24fabee9d1e663a9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_24fabee9d1e663a9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2529c0cafdc91179.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2529c0cafdc91179.verified.txt index 1764d8b9c6..90df5b30be 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2529c0cafdc91179.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2529c0cafdc91179.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2564e7908ed9dd7b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2564e7908ed9dd7b.verified.txt index addb92a480..15051928b5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2564e7908ed9dd7b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2564e7908ed9dd7b.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_259d6867a8ed6171.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_259d6867a8ed6171.verified.txt index d097a17595..93d5abced5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_259d6867a8ed6171.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_259d6867a8ed6171.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_25fb69ea149c90c9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_25fb69ea149c90c9.verified.txt index 0a21518dcb..d63a118199 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_25fb69ea149c90c9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_25fb69ea149c90c9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_260922a3e0d8581d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_260922a3e0d8581d.verified.txt index f6da509a7a..148b13469b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_260922a3e0d8581d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_260922a3e0d8581d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_261c870f0d111ba4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_261c870f0d111ba4.verified.txt index e3f80f5f38..eeecdb2467 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_261c870f0d111ba4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_261c870f0d111ba4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2645194458be46c0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2645194458be46c0.verified.txt index 932627c99d..3ed503c0d0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2645194458be46c0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2645194458be46c0.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_26611301a98bed1f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_26611301a98bed1f.verified.txt index 7fcdb1dae2..05f76abddf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_26611301a98bed1f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_26611301a98bed1f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_26b5d436d596c154.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_26b5d436d596c154.verified.txt index 074df630bd..445fe76958 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_26b5d436d596c154.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_26b5d436d596c154.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_271e3f56b631901b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_271e3f56b631901b.verified.txt index 51f18899a2..f8ea0ca015 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_271e3f56b631901b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_271e3f56b631901b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2744efb4c154b799.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2744efb4c154b799.verified.txt index 5dee2f0680..382c4bbe7a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2744efb4c154b799.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2744efb4c154b799.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_278fdfe4440baaca.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_278fdfe4440baaca.verified.txt index 3f6b77f808..f80c5bce11 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_278fdfe4440baaca.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_278fdfe4440baaca.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_281014695868ced4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_281014695868ced4.verified.txt index 8b214dfdb6..cf45673440 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_281014695868ced4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_281014695868ced4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28304c74c8cfa75d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28304c74c8cfa75d.verified.txt index 86dc595d39..1cbcca48ef 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28304c74c8cfa75d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28304c74c8cfa75d.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_284f81bdc8e2f848.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_284f81bdc8e2f848.verified.txt index 09a3633e7d..427288fffa 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_284f81bdc8e2f848.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_284f81bdc8e2f848.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2852cf494b22cd28.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2852cf494b22cd28.verified.txt index 28b395e87f..b66ea0989a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2852cf494b22cd28.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2852cf494b22cd28.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_286c122a8fea7156.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_286c122a8fea7156.verified.txt index 866d5ba28a..274f74430c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_286c122a8fea7156.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_286c122a8fea7156.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2874b51ad7347d6b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2874b51ad7347d6b.verified.txt index a9f4ee0713..3774102081 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2874b51ad7347d6b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2874b51ad7347d6b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28d3d747f0b9552e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28d3d747f0b9552e.verified.txt index eff3211d3e..d8f6e9bc30 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28d3d747f0b9552e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28d3d747f0b9552e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28e9037259018983.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28e9037259018983.verified.txt index fc9a91e9e1..35d0de6cc4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28e9037259018983.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_28e9037259018983.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_292eade54209a223.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_292eade54209a223.verified.txt index 43b02d939e..c02921ca15 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_292eade54209a223.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_292eade54209a223.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_29399418218bed92.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_29399418218bed92.verified.txt index c19c88eb67..cd6437996a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_29399418218bed92.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_29399418218bed92.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_295269260cb69114.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_295269260cb69114.verified.txt index 1b25cb84f0..cfde7e40ba 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_295269260cb69114.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_295269260cb69114.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_29ab68e235c1ec2f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_29ab68e235c1ec2f.verified.txt index 0e0ed2fae3..add14e0276 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_29ab68e235c1ec2f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_29ab68e235c1ec2f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a2224cec9866976.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a2224cec9866976.verified.txt index 2112492674..bf9d7f9ceb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a2224cec9866976.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a2224cec9866976.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a4b5767b0858093.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a4b5767b0858093.verified.txt index 1762fbf3ca..887e0bb61d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a4b5767b0858093.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a4b5767b0858093.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a7209565afdb641.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a7209565afdb641.verified.txt index b5c0f50a8d..b5508865ce 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a7209565afdb641.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a7209565afdb641.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a8d5fcbf3859063.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a8d5fcbf3859063.verified.txt index 6e4b8cf0d1..f24e2db172 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a8d5fcbf3859063.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2a8d5fcbf3859063.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ac85c69761c30b5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ac85c69761c30b5.verified.txt index 0557caccf5..4ee23b52e7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ac85c69761c30b5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ac85c69761c30b5.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2accadc708086ab1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2accadc708086ab1.verified.txt index 90690f5c74..df129978fe 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2accadc708086ab1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2accadc708086ab1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2aeb892fab480136.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2aeb892fab480136.verified.txt index b4ee19705c..a125ed39ba 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2aeb892fab480136.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2aeb892fab480136.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2b0ebc47f3146272.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2b0ebc47f3146272.verified.txt index 0e4d1a3d99..3a43cf1d19 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2b0ebc47f3146272.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2b0ebc47f3146272.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2b2620d8e04c8893.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2b2620d8e04c8893.verified.txt index b1c937bf92..a79996de8f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2b2620d8e04c8893.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2b2620d8e04c8893.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2bd32f7e28f0d6ad.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2bd32f7e28f0d6ad.verified.txt index c6d660ade5..1bbf56038e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2bd32f7e28f0d6ad.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2bd32f7e28f0d6ad.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2c05548eaede0540.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2c05548eaede0540.verified.txt index b0f32dd31b..98a495c322 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2c05548eaede0540.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2c05548eaede0540.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2c22e1f4c757d589.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2c22e1f4c757d589.verified.txt index dd0eac03aa..7622b7617f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2c22e1f4c757d589.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2c22e1f4c757d589.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ca058e130cdb067.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ca058e130cdb067.verified.txt index 4eadbcf2c9..835a3259d2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ca058e130cdb067.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ca058e130cdb067.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2cc409245afcb3a2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2cc409245afcb3a2.verified.txt index 8d61a8ea25..16005b8ad6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2cc409245afcb3a2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2cc409245afcb3a2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ce12968fe1903f1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ce12968fe1903f1.verified.txt index 5cc186a838..a405d5206b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ce12968fe1903f1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ce12968fe1903f1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2cfecad6e3207109.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2cfecad6e3207109.verified.txt index e6ce48791b..8758dde967 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2cfecad6e3207109.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2cfecad6e3207109.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d1cf699f9cdaa1e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d1cf699f9cdaa1e.verified.txt index c34f2610dd..e54a09b889 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d1cf699f9cdaa1e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d1cf699f9cdaa1e.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d3428daff799fd5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d3428daff799fd5.verified.txt index 49e9c328c2..87737ab75e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d3428daff799fd5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d3428daff799fd5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d3c73cfbc650a61.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d3c73cfbc650a61.verified.txt index 303c687f01..c92ebb781c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d3c73cfbc650a61.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d3c73cfbc650a61.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d5d89d8dbd8071e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d5d89d8dbd8071e.verified.txt index e7f899ca7c..e45f375ae8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d5d89d8dbd8071e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2d5d89d8dbd8071e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ddda2c35419e09a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ddda2c35419e09a.verified.txt index fabd14cd0f..7df705ca52 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ddda2c35419e09a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ddda2c35419e09a.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2e0216cc5e9a7b13.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2e0216cc5e9a7b13.verified.txt index 81690e51fe..d0780c0c80 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2e0216cc5e9a7b13.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2e0216cc5e9a7b13.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2e1c6b84847c5442.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2e1c6b84847c5442.verified.txt index 8b8194ded8..01485ac523 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2e1c6b84847c5442.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2e1c6b84847c5442.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ea0d2ca06caabb0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ea0d2ca06caabb0.verified.txt index 75c6572c31..14aab4956a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ea0d2ca06caabb0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2ea0d2ca06caabb0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2eafc7a425dab3e1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2eafc7a425dab3e1.verified.txt index 5663cea56a..3091a4f715 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2eafc7a425dab3e1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2eafc7a425dab3e1.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2eb835125bf877b9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2eb835125bf877b9.verified.txt index df5101b2cc..cdd4223328 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2eb835125bf877b9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2eb835125bf877b9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2f4272b58de0beda.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2f4272b58de0beda.verified.txt index fdc0f8f380..ca8eb3382e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2f4272b58de0beda.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2f4272b58de0beda.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2f531460d2852c3a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2f531460d2852c3a.verified.txt index 62c1778aaa..e51936e62e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2f531460d2852c3a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2f531460d2852c3a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fdb9130e92712bd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fdb9130e92712bd.verified.txt index 5714cc7340..d327ecf671 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fdb9130e92712bd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fdb9130e92712bd.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fdd03196b208cd1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fdd03196b208cd1.verified.txt index a4d27fc4f2..40549ffcdd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fdd03196b208cd1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fdd03196b208cd1.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fe241a334b98d7d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fe241a334b98d7d.verified.txt index 0f97d13e62..e6e8d4e4d7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fe241a334b98d7d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_2fe241a334b98d7d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_300eff856597e449.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_300eff856597e449.verified.txt index bf07f322f3..fcd3e45dee 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_300eff856597e449.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_300eff856597e449.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30568166dfeb54f2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30568166dfeb54f2.verified.txt index c3a9733e5f..3bdb9d89a0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30568166dfeb54f2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30568166dfeb54f2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30cd2caccbd734ce.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30cd2caccbd734ce.verified.txt index 4d8172fd0b..b3a12b3013 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30cd2caccbd734ce.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30cd2caccbd734ce.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30eff587f009df95.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30eff587f009df95.verified.txt index 28ee1d1334..36eb680df5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30eff587f009df95.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30eff587f009df95.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30fee62819f6b388.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30fee62819f6b388.verified.txt index 43eac71ed3..cd3d8c7ac1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30fee62819f6b388.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_30fee62819f6b388.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3116e1b838e6677e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3116e1b838e6677e.verified.txt index 8b1c4f1bb4..91267f4d48 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3116e1b838e6677e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3116e1b838e6677e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_311a029aada816fa.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_311a029aada816fa.verified.txt index b3fe345c8c..0dd6d792a1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_311a029aada816fa.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_311a029aada816fa.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31465aa51653700d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31465aa51653700d.verified.txt index e2b144bd60..4db690198b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31465aa51653700d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31465aa51653700d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_314676f0c3c7e023.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_314676f0c3c7e023.verified.txt index 477f397711..c5729c98f4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_314676f0c3c7e023.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_314676f0c3c7e023.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3179535455019f31.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3179535455019f31.verified.txt index 956a75beca..31ecd22d57 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3179535455019f31.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3179535455019f31.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31929d2b3533247c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31929d2b3533247c.verified.txt index 230daf3ca2..2327e34f84 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31929d2b3533247c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31929d2b3533247c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3194a3a5a51ca764.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3194a3a5a51ca764.verified.txt index f821301db8..d6ef48c483 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3194a3a5a51ca764.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3194a3a5a51ca764.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31aa86e44a30cf0d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31aa86e44a30cf0d.verified.txt index 846a8b3ed1..09bea63801 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31aa86e44a30cf0d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31aa86e44a30cf0d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31bc366c8ea5cc25.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31bc366c8ea5cc25.verified.txt index 1162054a3d..f69152b283 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31bc366c8ea5cc25.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_31bc366c8ea5cc25.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32cac00b30f4b51b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32cac00b30f4b51b.verified.txt index bcd073cf83..9a4ffc2b66 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32cac00b30f4b51b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32cac00b30f4b51b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32cc034e719dc886.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32cc034e719dc886.verified.txt index f6c9382363..7f68914dcf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32cc034e719dc886.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32cc034e719dc886.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32da88f0637a55d0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32da88f0637a55d0.verified.txt index 9984995e5c..7b954294b1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32da88f0637a55d0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_32da88f0637a55d0.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_332a163a340f14ce.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_332a163a340f14ce.verified.txt index f2f11d6156..4f57f36079 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_332a163a340f14ce.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_332a163a340f14ce.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_335a009f15c732a9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_335a009f15c732a9.verified.txt index 21606d65f8..0153e48945 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_335a009f15c732a9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_335a009f15c732a9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_33768261d4243105.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_33768261d4243105.verified.txt index d799feb341..4e5be3c4af 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_33768261d4243105.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_33768261d4243105.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_338e0a38bebabce5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_338e0a38bebabce5.verified.txt index 5e9514264e..a77ee44647 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_338e0a38bebabce5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_338e0a38bebabce5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34243c5faac034b4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34243c5faac034b4.verified.txt index 7aae961ca9..48c83c1876 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34243c5faac034b4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34243c5faac034b4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_342733679bf5f94d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_342733679bf5f94d.verified.txt index a1c0358d39..3c89b6bff1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_342733679bf5f94d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_342733679bf5f94d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_345244909532cd85.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_345244909532cd85.verified.txt index cce3169ab6..93a447a009 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_345244909532cd85.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_345244909532cd85.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3468176ed8be7a69.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3468176ed8be7a69.verified.txt index 7c70b97416..3002543e48 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3468176ed8be7a69.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3468176ed8be7a69.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34683f2d9d4efabb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34683f2d9d4efabb.verified.txt index 321de90445..ca3176056a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34683f2d9d4efabb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34683f2d9d4efabb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34a286383772d11a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34a286383772d11a.verified.txt index 6c0959a3d6..e254408239 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34a286383772d11a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34a286383772d11a.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34b789fb3755a83e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34b789fb3755a83e.verified.txt index f247fe7cb7..357e4d08a2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34b789fb3755a83e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34b789fb3755a83e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34b92ea726adb335.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34b92ea726adb335.verified.txt index 190195cdab..b24b708290 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34b92ea726adb335.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34b92ea726adb335.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34c2683459b46d85.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34c2683459b46d85.verified.txt index 41d444c868..c00c4f5230 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34c2683459b46d85.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34c2683459b46d85.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34ecbac7acc7aa4c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34ecbac7acc7aa4c.verified.txt index 2aeb400d28..5d5c79c121 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34ecbac7acc7aa4c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_34ecbac7acc7aa4c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_35898957647d84e2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_35898957647d84e2.verified.txt index 5eb9cbe16d..a107473dde 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_35898957647d84e2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_35898957647d84e2.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_35d30223d64defae.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_35d30223d64defae.verified.txt index c09263a787..4c1ca0a62a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_35d30223d64defae.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_35d30223d64defae.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3694dc209915e706.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3694dc209915e706.verified.txt index bfb4043462..ba15810a59 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3694dc209915e706.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3694dc209915e706.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_36cb928d06f0829b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_36cb928d06f0829b.verified.txt index 0d32246839..27b7aace3c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_36cb928d06f0829b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_36cb928d06f0829b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37014a9b6768c5fc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37014a9b6768c5fc.verified.txt index f2ba15c246..96cc9e2914 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37014a9b6768c5fc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37014a9b6768c5fc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3703343d8fc609f0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3703343d8fc609f0.verified.txt index e580eca5bc..a2a551c9cf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3703343d8fc609f0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3703343d8fc609f0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3772ded7258060a4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3772ded7258060a4.verified.txt index 75b44ab9b6..f245c32cf3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3772ded7258060a4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3772ded7258060a4.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37ad59bf5cfb8004.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37ad59bf5cfb8004.verified.txt index 00becfbc4d..27b2d00662 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37ad59bf5cfb8004.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37ad59bf5cfb8004.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37c42986bdb2b73d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37c42986bdb2b73d.verified.txt index 4158217a6a..83af8f9a11 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37c42986bdb2b73d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_37c42986bdb2b73d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_382b8f6d82aba32e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_382b8f6d82aba32e.verified.txt index 5b8947d1ad..f347f323c2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_382b8f6d82aba32e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_382b8f6d82aba32e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_383d41e8bc56c056.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_383d41e8bc56c056.verified.txt index 16995d2829..aaadaba930 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_383d41e8bc56c056.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_383d41e8bc56c056.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_38943aa04993744f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_38943aa04993744f.verified.txt index 2f7a8c848c..336246f4c1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_38943aa04993744f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_38943aa04993744f.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_38e1a10efbc8293a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_38e1a10efbc8293a.verified.txt index a6fb5a42c8..21a7856cb3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_38e1a10efbc8293a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_38e1a10efbc8293a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_39840509b03906a7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_39840509b03906a7.verified.txt index eeda5d6fa5..e8053ba166 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_39840509b03906a7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_39840509b03906a7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_39ae64a9458e6d8b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_39ae64a9458e6d8b.verified.txt index b02ed4f1d6..0726a650fb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_39ae64a9458e6d8b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_39ae64a9458e6d8b.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a0221055e119438.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a0221055e119438.verified.txt index 0eb8070f09..45b87adb9e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a0221055e119438.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a0221055e119438.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a2bc0945f39f4d7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a2bc0945f39f4d7.verified.txt index 859d4c84a5..1ae0d8d671 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a2bc0945f39f4d7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a2bc0945f39f4d7.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a32cd06109e810c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a32cd06109e810c.verified.txt index 5c5ecd35fe..bd53756fc8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a32cd06109e810c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a32cd06109e810c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a5047a6c04f96d8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a5047a6c04f96d8.verified.txt index cb95daf01b..5831d70bc6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a5047a6c04f96d8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a5047a6c04f96d8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a93cc37b32e94b3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a93cc37b32e94b3.verified.txt index b14ee675d9..906ccdbd79 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a93cc37b32e94b3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3a93cc37b32e94b3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ad92db3c912ca17.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ad92db3c912ca17.verified.txt index 295da952f6..e78f17d43d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ad92db3c912ca17.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ad92db3c912ca17.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b1a4290846be8e0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b1a4290846be8e0.verified.txt index 2305cc72a0..8f745424b8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b1a4290846be8e0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b1a4290846be8e0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b3f53dd77a4cc44.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b3f53dd77a4cc44.verified.txt index b15bb0fff0..a42cb498c4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b3f53dd77a4cc44.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b3f53dd77a4cc44.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b78a29543ede443.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b78a29543ede443.verified.txt index accb9fe3f1..21eebf42e5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b78a29543ede443.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3b78a29543ede443.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3c33a88de7a6bf6c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3c33a88de7a6bf6c.verified.txt index 09228aa7c4..00c0d92bfe 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3c33a88de7a6bf6c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3c33a88de7a6bf6c.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3c8ed8eae8c3a191.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3c8ed8eae8c3a191.verified.txt index b597a1cdf5..5d9cc4fc6d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3c8ed8eae8c3a191.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3c8ed8eae8c3a191.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ca4ec974a98ce93.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ca4ec974a98ce93.verified.txt index f5a041800f..ddbaae377b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ca4ec974a98ce93.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ca4ec974a98ce93.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ccb897cd1349293.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ccb897cd1349293.verified.txt index 380a545994..a9f3f1806b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ccb897cd1349293.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ccb897cd1349293.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d063870d0c74f42.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d063870d0c74f42.verified.txt index 637400308e..40d4b466ef 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d063870d0c74f42.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d063870d0c74f42.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d2485664cc236fe.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d2485664cc236fe.verified.txt index 4aa3d70118..66ae9910f7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d2485664cc236fe.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d2485664cc236fe.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d710288a019f048.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d710288a019f048.verified.txt index 3d5b9c7d54..efc0ea532f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d710288a019f048.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3d710288a019f048.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3daf5034a6acd276.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3daf5034a6acd276.verified.txt index a4fe2ccb52..8b08fb992e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3daf5034a6acd276.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3daf5034a6acd276.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3db061fac1d4fedb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3db061fac1d4fedb.verified.txt index 746b47f88b..54d5554d80 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3db061fac1d4fedb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3db061fac1d4fedb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3dfbe12868b7248b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3dfbe12868b7248b.verified.txt index 9114605d27..65d255d026 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3dfbe12868b7248b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3dfbe12868b7248b.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3dfe67a2b6248c98.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3dfe67a2b6248c98.verified.txt index 4bc88d72ed..8d3bcbb17b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3dfe67a2b6248c98.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3dfe67a2b6248c98.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e08d8dd3ecd70a2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e08d8dd3ecd70a2.verified.txt index 4d2588f2d5..1d2b09f586 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e08d8dd3ecd70a2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e08d8dd3ecd70a2.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e4fd364ed826b09.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e4fd364ed826b09.verified.txt index 9ed4998682..42d4880b76 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e4fd364ed826b09.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e4fd364ed826b09.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e95872e492c937e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e95872e492c937e.verified.txt index 5d2c0e21a0..fc6b7cdf24 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e95872e492c937e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e95872e492c937e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e9de609a2aae942.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e9de609a2aae942.verified.txt index ab9f754ae6..c20cb6d550 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e9de609a2aae942.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3e9de609a2aae942.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ef0ed5758e46741.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ef0ed5758e46741.verified.txt index 7661d42494..3143ce461c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ef0ed5758e46741.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3ef0ed5758e46741.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3eff94995e47ee58.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3eff94995e47ee58.verified.txt index 90dc76ef26..d197a31cc7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3eff94995e47ee58.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3eff94995e47ee58.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f168af0a695e292.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f168af0a695e292.verified.txt index f08ef9d13f..5851c0055d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f168af0a695e292.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f168af0a695e292.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f168e81cf8ade65.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f168e81cf8ade65.verified.txt index 777666b9a0..a7bdcd86b7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f168e81cf8ade65.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f168e81cf8ade65.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f6779ef312bf114.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f6779ef312bf114.verified.txt index 9161568592..fb078e4321 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f6779ef312bf114.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f6779ef312bf114.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f8bf9e57603dc9d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f8bf9e57603dc9d.verified.txt index cef1dab6f5..7083fa1e02 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f8bf9e57603dc9d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3f8bf9e57603dc9d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3faf072af12bd3d4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3faf072af12bd3d4.verified.txt index 4d70dae399..b952de193a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3faf072af12bd3d4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_3faf072af12bd3d4.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4014359b7c8cc4db.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4014359b7c8cc4db.verified.txt index 0b11a4528a..53924c7667 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4014359b7c8cc4db.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4014359b7c8cc4db.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_408038874b3b2535.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_408038874b3b2535.verified.txt index 4ddf6707ac..896fa2355f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_408038874b3b2535.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_408038874b3b2535.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_40914917a856ae3f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_40914917a856ae3f.verified.txt index 8f01697770..57edfae3ac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_40914917a856ae3f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_40914917a856ae3f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_40fdd634fdadf6ea.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_40fdd634fdadf6ea.verified.txt index b02a988ddd..3227908a20 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_40fdd634fdadf6ea.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_40fdd634fdadf6ea.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_414609e48fe26657.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_414609e48fe26657.verified.txt index 3e1ccd2893..74d8dc01ba 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_414609e48fe26657.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_414609e48fe26657.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_417fbece372c9259.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_417fbece372c9259.verified.txt index e974a55a5a..c1a3581de0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_417fbece372c9259.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_417fbece372c9259.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41a73b9b171b6060.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41a73b9b171b6060.verified.txt index c3f5475c25..74652ee3ac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41a73b9b171b6060.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41a73b9b171b6060.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41bb0e875b4e171c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41bb0e875b4e171c.verified.txt index 4976750d10..5d30e6b0c9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41bb0e875b4e171c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41bb0e875b4e171c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41cfe7f9e2421d4a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41cfe7f9e2421d4a.verified.txt index a6ce757398..737ac613bb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41cfe7f9e2421d4a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_41cfe7f9e2421d4a.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_421e7d510b5c4a54.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_421e7d510b5c4a54.verified.txt index 3629a75f2d..e4ff8f4fa6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_421e7d510b5c4a54.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_421e7d510b5c4a54.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4279d01d7c579114.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4279d01d7c579114.verified.txt index bf79651ea1..e1b31c7aac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4279d01d7c579114.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4279d01d7c579114.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4302d85c82e3957f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4302d85c82e3957f.verified.txt index b5c25006ab..2bd6bd057b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4302d85c82e3957f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4302d85c82e3957f.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4308a457a615694b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4308a457a615694b.verified.txt index 01add6e7f9..e4145456e7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4308a457a615694b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4308a457a615694b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434222db24264efc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434222db24264efc.verified.txt index d9d456e507..2d58afce8f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434222db24264efc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434222db24264efc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434c35b947addd50.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434c35b947addd50.verified.txt index 5710b38921..660333de63 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434c35b947addd50.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434c35b947addd50.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434cdf80ad36f5e1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434cdf80ad36f5e1.verified.txt index c2d10dd873..8a5971a6f4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434cdf80ad36f5e1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_434cdf80ad36f5e1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_438ceff8f25d734d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_438ceff8f25d734d.verified.txt index b4b67f0ba1..40897365fe 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_438ceff8f25d734d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_438ceff8f25d734d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43c805d53a630e4c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43c805d53a630e4c.verified.txt index 1f5c930f93..78d06c4712 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43c805d53a630e4c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43c805d53a630e4c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43ca86b4c90eb9a5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43ca86b4c90eb9a5.verified.txt index e705847280..00bcf3628e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43ca86b4c90eb9a5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43ca86b4c90eb9a5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43ccda93fb34f87a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43ccda93fb34f87a.verified.txt index 8539e61282..248c23ad97 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43ccda93fb34f87a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43ccda93fb34f87a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43e828da7c85bf6e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43e828da7c85bf6e.verified.txt index 22176930e8..9adc4b8b5f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43e828da7c85bf6e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43e828da7c85bf6e.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43e84152c5f403b7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43e84152c5f403b7.verified.txt index d7d712f0b5..47f58d80d7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43e84152c5f403b7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43e84152c5f403b7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43eda71639fbdeb5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43eda71639fbdeb5.verified.txt index a283389fd6..662800803b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43eda71639fbdeb5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_43eda71639fbdeb5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_444df4a9adc68401.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_444df4a9adc68401.verified.txt index 5997883c97..9ab8252325 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_444df4a9adc68401.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_444df4a9adc68401.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_446975e6870743bf.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_446975e6870743bf.verified.txt index ebf3100fc1..a1234b0cc1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_446975e6870743bf.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_446975e6870743bf.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_449f2764e6b9fb50.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_449f2764e6b9fb50.verified.txt index 47170e8be3..f7abf73d8e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_449f2764e6b9fb50.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_449f2764e6b9fb50.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_44b1b8e5ec45f12a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_44b1b8e5ec45f12a.verified.txt index 64c9e22306..14edb58d73 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_44b1b8e5ec45f12a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_44b1b8e5ec45f12a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_44f041bae9639b52.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_44f041bae9639b52.verified.txt index 437365c3e3..08c8bcabd8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_44f041bae9639b52.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_44f041bae9639b52.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_45a10c139a0e8465.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_45a10c139a0e8465.verified.txt index 0fd4fe2fc6..389dbb1945 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_45a10c139a0e8465.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_45a10c139a0e8465.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_45b283e822620442.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_45b283e822620442.verified.txt index 9ba89c3eab..df7992931d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_45b283e822620442.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_45b283e822620442.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4668268cd71e8431.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4668268cd71e8431.verified.txt index f86615f957..1cfd42ae35 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4668268cd71e8431.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4668268cd71e8431.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_46e0f2bda685ee7c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_46e0f2bda685ee7c.verified.txt index b5ce2f0b49..7af438d142 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_46e0f2bda685ee7c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_46e0f2bda685ee7c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47b9d9a6ce8afa2a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47b9d9a6ce8afa2a.verified.txt index 687762d79d..e05721d89c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47b9d9a6ce8afa2a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47b9d9a6ce8afa2a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47c20f17eab9b960.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47c20f17eab9b960.verified.txt index 0bebff269c..0b959d8904 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47c20f17eab9b960.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47c20f17eab9b960.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47c284de9a4136a4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47c284de9a4136a4.verified.txt index 4252e3c0c6..e06e78c13e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47c284de9a4136a4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_47c284de9a4136a4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4841829b0f158dd8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4841829b0f158dd8.verified.txt index f99cbd59e9..fe112be730 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4841829b0f158dd8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4841829b0f158dd8.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4889a308b95fa589.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4889a308b95fa589.verified.txt index 1df4b604b4..40b7025f4c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4889a308b95fa589.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4889a308b95fa589.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_48cda1840f5b240a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_48cda1840f5b240a.verified.txt index 861165cdb6..a95da65365 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_48cda1840f5b240a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_48cda1840f5b240a.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_48dcd0931f84d443.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_48dcd0931f84d443.verified.txt index 3da352155f..2be75b6a89 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_48dcd0931f84d443.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_48dcd0931f84d443.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4909d71a3ec49747.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4909d71a3ec49747.verified.txt index 8c5dfede38..9bee6c1b89 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4909d71a3ec49747.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4909d71a3ec49747.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_490b3fc53b31fad0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_490b3fc53b31fad0.verified.txt index 1d73220a95..818f590bab 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_490b3fc53b31fad0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_490b3fc53b31fad0.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4923c9771089082d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4923c9771089082d.verified.txt index e6888557cc..de8404d602 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4923c9771089082d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4923c9771089082d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4970b602c9ab0e26.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4970b602c9ab0e26.verified.txt index e5421504f8..046f1fafe9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4970b602c9ab0e26.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4970b602c9ab0e26.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49a7d1f928703af8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49a7d1f928703af8.verified.txt index 543bf9df0c..2e8755085b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49a7d1f928703af8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49a7d1f928703af8.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49ad833549b12c26.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49ad833549b12c26.verified.txt index cae1373d71..71c28d262c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49ad833549b12c26.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49ad833549b12c26.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49d7e9ff103bbc51.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49d7e9ff103bbc51.verified.txt index 1f0513451c..3cc6558099 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49d7e9ff103bbc51.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49d7e9ff103bbc51.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49e8f01ea7a363ad.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49e8f01ea7a363ad.verified.txt index ff281b1188..c3548ec947 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49e8f01ea7a363ad.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49e8f01ea7a363ad.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49ed4aa2c7b73924.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49ed4aa2c7b73924.verified.txt index 6829398b7d..7c410ccb8b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49ed4aa2c7b73924.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_49ed4aa2c7b73924.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a080a9a61adb5f4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a080a9a61adb5f4.verified.txt index 3155891241..d01b14ec59 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a080a9a61adb5f4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a080a9a61adb5f4.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a391d871795c2ed.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a391d871795c2ed.verified.txt index aaa5056273..0dba51246b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a391d871795c2ed.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a391d871795c2ed.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a78fe4993b48bd8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a78fe4993b48bd8.verified.txt index 42f93d8203..ce80b03d9f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a78fe4993b48bd8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a78fe4993b48bd8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a7ecf688571652d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a7ecf688571652d.verified.txt index 68859248a8..5d7924f1ec 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a7ecf688571652d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a7ecf688571652d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a8dfe9c08616a30.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a8dfe9c08616a30.verified.txt index 9d4a4e919d..322ecf79a3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a8dfe9c08616a30.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a8dfe9c08616a30.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a920f8e6b647efc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a920f8e6b647efc.verified.txt index 3ba2a55bd4..040a18dca2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a920f8e6b647efc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4a920f8e6b647efc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ae14db179ce6442.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ae14db179ce6442.verified.txt index 5ce92647a7..6a49c894c6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ae14db179ce6442.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ae14db179ce6442.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b03b3e761c13f7d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b03b3e761c13f7d.verified.txt index f8a6269615..de87acd502 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b03b3e761c13f7d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b03b3e761c13f7d.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b18a884a32a5c56.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b18a884a32a5c56.verified.txt index 9aff72f4dc..3451b33a44 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b18a884a32a5c56.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b18a884a32a5c56.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b86cb021d6172b2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b86cb021d6172b2.verified.txt index a44277c33b..202399b2e3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b86cb021d6172b2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4b86cb021d6172b2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4c579309348b97c8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4c579309348b97c8.verified.txt index e82ec5db92..db726cca9f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4c579309348b97c8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4c579309348b97c8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4cc36a7fc18ff98c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4cc36a7fc18ff98c.verified.txt index 3f5c94a69b..0de73bc8b4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4cc36a7fc18ff98c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4cc36a7fc18ff98c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d2ce9e4e21faede.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d2ce9e4e21faede.verified.txt index 6bb01854ed..83f3922f07 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d2ce9e4e21faede.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d2ce9e4e21faede.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d32b00259887c95.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d32b00259887c95.verified.txt index e19808fed5..ac88d79db7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d32b00259887c95.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d32b00259887c95.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d49d108804134ef.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d49d108804134ef.verified.txt index 313fc5e08b..147d9fb093 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d49d108804134ef.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d49d108804134ef.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d8d834b2173d42b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d8d834b2173d42b.verified.txt index e10a4e0e03..f23c764291 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d8d834b2173d42b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4d8d834b2173d42b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4dc5859b3fd630f1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4dc5859b3fd630f1.verified.txt index 85fd913585..b0c7f79589 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4dc5859b3fd630f1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4dc5859b3fd630f1.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4dd0abdef35f8678.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4dd0abdef35f8678.verified.txt index 8ac172d3dd..a575296243 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4dd0abdef35f8678.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4dd0abdef35f8678.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e13642bf696b28d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e13642bf696b28d.verified.txt index 53f397036a..2b23d02006 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e13642bf696b28d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e13642bf696b28d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e2a1c7b7dd3f886.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e2a1c7b7dd3f886.verified.txt index 65617cfbfa..90ccda9e34 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e2a1c7b7dd3f886.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e2a1c7b7dd3f886.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e2f22127fbabc9e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e2f22127fbabc9e.verified.txt index abdd801826..0f9515bc14 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e2f22127fbabc9e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e2f22127fbabc9e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e90cbad4e254d8a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e90cbad4e254d8a.verified.txt index c5c6aa50dd..e00ce4770c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e90cbad4e254d8a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4e90cbad4e254d8a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ebfa07df0ae8247.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ebfa07df0ae8247.verified.txt index 3896b1a5a6..a378aa9170 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ebfa07df0ae8247.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ebfa07df0ae8247.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ede022de5059921.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ede022de5059921.verified.txt index f277101576..f156c0fec2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ede022de5059921.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ede022de5059921.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f32ea6a14dd642d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f32ea6a14dd642d.verified.txt index a0e055fd31..38c089dea5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f32ea6a14dd642d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f32ea6a14dd642d.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f430bf2c3abe6ed.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f430bf2c3abe6ed.verified.txt index 98a503d586..88f2a9b23d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f430bf2c3abe6ed.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f430bf2c3abe6ed.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f6368a329777588.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f6368a329777588.verified.txt index 708fe08c62..5926adbd5e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f6368a329777588.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f6368a329777588.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f6f88ecc62c2d18.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f6f88ecc62c2d18.verified.txt index b0e51dcec7..26c4dbca87 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f6f88ecc62c2d18.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f6f88ecc62c2d18.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f757e3dc345a6d6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f757e3dc345a6d6.verified.txt index 89e840c6f9..db5f5468a3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f757e3dc345a6d6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4f757e3dc345a6d6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4fad923958715aea.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4fad923958715aea.verified.txt index 19363c30d2..e221ee4b63 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4fad923958715aea.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4fad923958715aea.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ffc820bd9f027ac.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ffc820bd9f027ac.verified.txt index 3993287e30..de09e8e5bd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ffc820bd9f027ac.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_4ffc820bd9f027ac.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50a6af1e11b0318a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50a6af1e11b0318a.verified.txt index 7e37955ae3..dabed54234 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50a6af1e11b0318a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50a6af1e11b0318a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50b916edf97941f5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50b916edf97941f5.verified.txt index 24b92b94fa..4c17c88451 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50b916edf97941f5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50b916edf97941f5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50e2fb5a4e6dbd16.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50e2fb5a4e6dbd16.verified.txt index 6348f64a49..ec18f082f1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50e2fb5a4e6dbd16.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_50e2fb5a4e6dbd16.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5107e9033bbf1cba.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5107e9033bbf1cba.verified.txt index 1839236f57..076e28c5cf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5107e9033bbf1cba.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5107e9033bbf1cba.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5189be4c6f7fc47d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5189be4c6f7fc47d.verified.txt index 11a1a49534..db9e67da7b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5189be4c6f7fc47d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5189be4c6f7fc47d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_518ab90b1e1c7b8e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_518ab90b1e1c7b8e.verified.txt index a314754975..bf5e893f0c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_518ab90b1e1c7b8e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_518ab90b1e1c7b8e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51b126a6fe0ebe6c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51b126a6fe0ebe6c.verified.txt index a10066a655..e8fd326d55 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51b126a6fe0ebe6c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51b126a6fe0ebe6c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51c65fe456368f81.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51c65fe456368f81.verified.txt index cc82d4cb49..64f45dafe5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51c65fe456368f81.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51c65fe456368f81.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51f597b7d6d4b2a0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51f597b7d6d4b2a0.verified.txt index eb53b1c794..2788f0f8ea 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51f597b7d6d4b2a0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_51f597b7d6d4b2a0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5201e622f66c84b8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5201e622f66c84b8.verified.txt index 8418d896c4..99f727c584 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5201e622f66c84b8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5201e622f66c84b8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_520b95940ae6fb71.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_520b95940ae6fb71.verified.txt index c03ec3c756..1e6d48f605 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_520b95940ae6fb71.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_520b95940ae6fb71.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_520d15b251663de6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_520d15b251663de6.verified.txt index 653812fe66..fdecc1427d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_520d15b251663de6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_520d15b251663de6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5213a5db03dbeef5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5213a5db03dbeef5.verified.txt index 535bdefa0f..567795e1ee 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5213a5db03dbeef5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5213a5db03dbeef5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_525460eac3675c58.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_525460eac3675c58.verified.txt index 962630fe0e..bf3d7155f7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_525460eac3675c58.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_525460eac3675c58.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_52644926cabe1f9a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_52644926cabe1f9a.verified.txt index 127971ccf5..637870ff32 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_52644926cabe1f9a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_52644926cabe1f9a.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_526560811eb11382.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_526560811eb11382.verified.txt index 8520293ec6..ccbbad32e4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_526560811eb11382.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_526560811eb11382.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5276cbe9ed44174c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5276cbe9ed44174c.verified.txt index 7ce1a4c079..ef4dab790f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5276cbe9ed44174c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5276cbe9ed44174c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_533dceb6fb18b6de.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_533dceb6fb18b6de.verified.txt index 054720ee4e..f40b387bac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_533dceb6fb18b6de.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_533dceb6fb18b6de.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53403bfaff522f1b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53403bfaff522f1b.verified.txt index 07a0996c43..7c23051f84 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53403bfaff522f1b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53403bfaff522f1b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53f8b5b771e17501.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53f8b5b771e17501.verified.txt index 42727cf810..b992da2421 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53f8b5b771e17501.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53f8b5b771e17501.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53fed3db3b4c1704.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53fed3db3b4c1704.verified.txt index 1d05c3d339..1895f73d4e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53fed3db3b4c1704.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_53fed3db3b4c1704.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_54382f89b64a6cd5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_54382f89b64a6cd5.verified.txt index 13aa732c68..80ada1792b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_54382f89b64a6cd5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_54382f89b64a6cd5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_54570a6446a67625.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_54570a6446a67625.verified.txt index fec018864f..478810bc14 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_54570a6446a67625.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_54570a6446a67625.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_556ddbf73d404cd7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_556ddbf73d404cd7.verified.txt index 5aa18d4212..75f6813643 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_556ddbf73d404cd7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_556ddbf73d404cd7.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_558da4bf742bdd0c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_558da4bf742bdd0c.verified.txt index cacc0684b0..5ec41a38bc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_558da4bf742bdd0c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_558da4bf742bdd0c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_564ff9ff3afdf0db.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_564ff9ff3afdf0db.verified.txt index beccf36d43..eb325cf0bb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_564ff9ff3afdf0db.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_564ff9ff3afdf0db.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56ad76baafec1037.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56ad76baafec1037.verified.txt index dca86376ca..494927d51b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56ad76baafec1037.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56ad76baafec1037.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56c55021b359540e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56c55021b359540e.verified.txt index 42c237e342..d2bd86855a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56c55021b359540e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56c55021b359540e.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56e3640fec47c739.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56e3640fec47c739.verified.txt index 9db5a1a419..53667f9075 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56e3640fec47c739.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_56e3640fec47c739.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_578270707a743649.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_578270707a743649.verified.txt index 4951399d21..7e9a1869e6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_578270707a743649.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_578270707a743649.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5788cead851636a3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5788cead851636a3.verified.txt index af18dc3428..6228a4d2ff 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5788cead851636a3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5788cead851636a3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57be41d86bcdf3b6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57be41d86bcdf3b6.verified.txt index 8a75993367..863c515834 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57be41d86bcdf3b6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57be41d86bcdf3b6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57f25b9da9f5acc4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57f25b9da9f5acc4.verified.txt index 4cd85b5b48..b9f3f2f878 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57f25b9da9f5acc4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57f25b9da9f5acc4.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57fcd364458c5825.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57fcd364458c5825.verified.txt index b6ac145671..2a577b0861 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57fcd364458c5825.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_57fcd364458c5825.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58551337a41f932d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58551337a41f932d.verified.txt index 3fb940f0e6..22152faa44 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58551337a41f932d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58551337a41f932d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5871f8fae30f854b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5871f8fae30f854b.verified.txt index 0af5a1186b..e7f02d244f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5871f8fae30f854b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5871f8fae30f854b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58a72b30a198218c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58a72b30a198218c.verified.txt index d487b02f91..9f17de0bc3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58a72b30a198218c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58a72b30a198218c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58be7dd3babe5e29.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58be7dd3babe5e29.verified.txt index 96c3d86ab1..626a9d29f2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58be7dd3babe5e29.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58be7dd3babe5e29.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58c3c540cbbc6059.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58c3c540cbbc6059.verified.txt index 425914e015..1d8de13fa0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58c3c540cbbc6059.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58c3c540cbbc6059.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58f311890e243a66.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58f311890e243a66.verified.txt index 92d6a2f046..882b2f0bba 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58f311890e243a66.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_58f311890e243a66.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5901fa774c05386e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5901fa774c05386e.verified.txt index a76c9da57f..c6160b67d5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5901fa774c05386e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5901fa774c05386e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5961d85ec5e2833b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5961d85ec5e2833b.verified.txt index 7bca9b1677..b5c9645fbc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5961d85ec5e2833b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5961d85ec5e2833b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5994179fde12124b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5994179fde12124b.verified.txt index a23d30240e..8b69a7c2fe 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5994179fde12124b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5994179fde12124b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_599c7b0b1f19ff20.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_599c7b0b1f19ff20.verified.txt index 8a50019bb7..b1e286609c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_599c7b0b1f19ff20.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_599c7b0b1f19ff20.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5a4e79b41953b158.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5a4e79b41953b158.verified.txt index 2081b531f0..4e6daa0591 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5a4e79b41953b158.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5a4e79b41953b158.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5a774fede1a8b693.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5a774fede1a8b693.verified.txt index 69a6d4c7ff..ffcd75462c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5a774fede1a8b693.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5a774fede1a8b693.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aa38c97ad625201.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aa38c97ad625201.verified.txt index 38a1d06734..387b2a572b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aa38c97ad625201.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aa38c97ad625201.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aa6095294b4e315.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aa6095294b4e315.verified.txt index afc7846939..10513bb08e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aa6095294b4e315.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aa6095294b4e315.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aca2636f36d5a85.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aca2636f36d5a85.verified.txt index 578f72ecf6..2df42b3a61 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aca2636f36d5a85.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5aca2636f36d5a85.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5af19078558bef22.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5af19078558bef22.verified.txt index a8a6f7acd2..a8a68511dd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5af19078558bef22.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5af19078558bef22.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b229a7250833d3b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b229a7250833d3b.verified.txt index 0d2dd115f8..b30a029b7f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b229a7250833d3b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b229a7250833d3b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b2355013c37f4a3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b2355013c37f4a3.verified.txt index 891ee45c43..63d3e72ff2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b2355013c37f4a3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b2355013c37f4a3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b4d2bfedf4bf30f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b4d2bfedf4bf30f.verified.txt index 9b21edb3da..ee0e74492d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b4d2bfedf4bf30f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b4d2bfedf4bf30f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b4ea340c55b0872.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b4ea340c55b0872.verified.txt index a328cbd891..9939000570 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b4ea340c55b0872.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b4ea340c55b0872.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b601a9a850b9a5d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b601a9a850b9a5d.verified.txt index e9afe20f6a..0063866e2f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b601a9a850b9a5d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5b601a9a850b9a5d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bacb80303fdafee.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bacb80303fdafee.verified.txt index bb6165e254..42afd9e89d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bacb80303fdafee.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bacb80303fdafee.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bafbd037cbc4cda.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bafbd037cbc4cda.verified.txt index 3006140c98..e6b56c9fbe 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bafbd037cbc4cda.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bafbd037cbc4cda.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bf05d24d75004eb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bf05d24d75004eb.verified.txt index 6f268d9129..ed04d5ad82 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bf05d24d75004eb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bf05d24d75004eb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bf67f18dc7c4b1b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bf67f18dc7c4b1b.verified.txt index 7627ef7fae..b0159dcda5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bf67f18dc7c4b1b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5bf67f18dc7c4b1b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c42d7c6b7b34b8a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c42d7c6b7b34b8a.verified.txt index 16f6ad0bd0..92dcc2c911 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c42d7c6b7b34b8a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c42d7c6b7b34b8a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c4dcbeb9c63ad0b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c4dcbeb9c63ad0b.verified.txt index 09b227c839..d2e3986fdb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c4dcbeb9c63ad0b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c4dcbeb9c63ad0b.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c5312f30d4818c4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c5312f30d4818c4.verified.txt index 36ad9ce6d1..474196196b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c5312f30d4818c4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5c5312f30d4818c4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5ca4695a895071bb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5ca4695a895071bb.verified.txt index 6b6f210ffd..739366409f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5ca4695a895071bb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5ca4695a895071bb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5cfaf30d1848cd0d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5cfaf30d1848cd0d.verified.txt index 9d57d79b30..9bf512228f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5cfaf30d1848cd0d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5cfaf30d1848cd0d.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d14c1cf19ffedab.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d14c1cf19ffedab.verified.txt index fe5c9e4d30..6c053bfbc2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d14c1cf19ffedab.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d14c1cf19ffedab.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d19523a7283dcad.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d19523a7283dcad.verified.txt index cce904bb6f..a6cc507772 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d19523a7283dcad.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d19523a7283dcad.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d1feb8b4a54fe83.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d1feb8b4a54fe83.verified.txt index 25aba16826..f4d08a4d96 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d1feb8b4a54fe83.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d1feb8b4a54fe83.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d38c1e1af59bb62.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d38c1e1af59bb62.verified.txt index 0dad9ca1f4..8e1c04dcf3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d38c1e1af59bb62.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d38c1e1af59bb62.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d8a68a445b61578.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d8a68a445b61578.verified.txt index 7a9ac521ba..3203e62b75 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d8a68a445b61578.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5d8a68a445b61578.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5db612bdfa130760.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5db612bdfa130760.verified.txt index 82d3a25adf..fd867ef500 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5db612bdfa130760.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5db612bdfa130760.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5dfa4e64dd2f8ff6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5dfa4e64dd2f8ff6.verified.txt index 5bba922b50..3dae3dd0e6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5dfa4e64dd2f8ff6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5dfa4e64dd2f8ff6.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e025b806d1f6287.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e025b806d1f6287.verified.txt index 1f2f7b6435..c10f42ce09 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e025b806d1f6287.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e025b806d1f6287.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e46335c65f68a48.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e46335c65f68a48.verified.txt index 1b32a838be..360b57ae91 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e46335c65f68a48.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e46335c65f68a48.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e891d27051bd1bc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e891d27051bd1bc.verified.txt index cbe1aed41b..3a02c84bba 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e891d27051bd1bc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5e891d27051bd1bc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5eb3cf0a765e83ec.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5eb3cf0a765e83ec.verified.txt index 2632fd1cc4..092de29c0d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5eb3cf0a765e83ec.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5eb3cf0a765e83ec.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5ebee570727caefa.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5ebee570727caefa.verified.txt index 91da68ba99..ebd62b0c34 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5ebee570727caefa.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5ebee570727caefa.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5eef664b6e716ed5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5eef664b6e716ed5.verified.txt index b2212f0bb6..9458a4ee23 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5eef664b6e716ed5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5eef664b6e716ed5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5f69a5efefa4e515.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5f69a5efefa4e515.verified.txt index 2cacd4177d..b39f2f8385 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5f69a5efefa4e515.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5f69a5efefa4e515.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5f93f267242fa39d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5f93f267242fa39d.verified.txt index 2d90e00dc5..fd61cb16e3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5f93f267242fa39d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_5f93f267242fa39d.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6016e750234580e0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6016e750234580e0.verified.txt index 7eda1f3015..d7f29f4684 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6016e750234580e0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6016e750234580e0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_601bd44dcc6dceeb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_601bd44dcc6dceeb.verified.txt index de53bdb8e1..04f1786eda 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_601bd44dcc6dceeb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_601bd44dcc6dceeb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6049a1c6ea8c574f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6049a1c6ea8c574f.verified.txt index ef180eaeb0..8d97942c6a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6049a1c6ea8c574f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6049a1c6ea8c574f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6077a76c7b442f6e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6077a76c7b442f6e.verified.txt index dec09fe492..32d904e7f0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6077a76c7b442f6e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6077a76c7b442f6e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6086c56527d5c686.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6086c56527d5c686.verified.txt index 1f4ecfc007..1925e3e72c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6086c56527d5c686.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6086c56527d5c686.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_608e6edcd10a3d83.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_608e6edcd10a3d83.verified.txt index d5c86f614f..61a9acef5a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_608e6edcd10a3d83.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_608e6edcd10a3d83.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60931bab81fd88a0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60931bab81fd88a0.verified.txt index 855697bdcf..ff5ecec2ab 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60931bab81fd88a0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60931bab81fd88a0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60c8641bf80b27e1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60c8641bf80b27e1.verified.txt index 82c902300f..f405094111 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60c8641bf80b27e1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60c8641bf80b27e1.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60ea55c355163197.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60ea55c355163197.verified.txt index a6530a4fca..67239f601d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60ea55c355163197.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_60ea55c355163197.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6112ac37cc3b18fa.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6112ac37cc3b18fa.verified.txt index 41f8fe308d..99353f3bc2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6112ac37cc3b18fa.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6112ac37cc3b18fa.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_611d9befd71a5b90.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_611d9befd71a5b90.verified.txt index 2330eafe8f..b23428a258 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_611d9befd71a5b90.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_611d9befd71a5b90.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_615502d945ceb714.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_615502d945ceb714.verified.txt index 66a45613a1..a37cea3037 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_615502d945ceb714.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_615502d945ceb714.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_621eb62242ff1655.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_621eb62242ff1655.verified.txt index ac7d65d272..d3340e4449 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_621eb62242ff1655.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_621eb62242ff1655.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62512b185bd25154.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62512b185bd25154.verified.txt index 6c381f7ed9..0cc2135fb9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62512b185bd25154.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62512b185bd25154.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6298f5fc986f7be3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6298f5fc986f7be3.verified.txt index 84c4df6a1e..41736535c1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6298f5fc986f7be3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6298f5fc986f7be3.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c004614c56dfb6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c004614c56dfb6.verified.txt index fd80247cff..374739fdcb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c004614c56dfb6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c004614c56dfb6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c61cd9e73e4389.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c61cd9e73e4389.verified.txt index c207f7a61b..44a1233d3f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c61cd9e73e4389.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c61cd9e73e4389.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c6bff3063056da.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c6bff3063056da.verified.txt index 7fd41da12f..bfb8691fbe 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c6bff3063056da.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62c6bff3063056da.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62eb66e88264a125.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62eb66e88264a125.verified.txt index 4c395883f7..f3db0db418 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62eb66e88264a125.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_62eb66e88264a125.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6357244baf093f12.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6357244baf093f12.verified.txt index f782fb0edc..b95f3ac379 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6357244baf093f12.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6357244baf093f12.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_63ab180610a45df5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_63ab180610a45df5.verified.txt index bf243fa43b..ed87436953 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_63ab180610a45df5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_63ab180610a45df5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_63f82c17dc6853ae.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_63f82c17dc6853ae.verified.txt index 7af0470122..3da3f8a15c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_63f82c17dc6853ae.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_63f82c17dc6853ae.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64175d46d7146515.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64175d46d7146515.verified.txt index a29c7ad536..479b15a1dd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64175d46d7146515.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64175d46d7146515.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_641af3ff9a203f7f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_641af3ff9a203f7f.verified.txt index 14152f52a4..42a4c7e8e5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_641af3ff9a203f7f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_641af3ff9a203f7f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64a35b175d7f7ebc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64a35b175d7f7ebc.verified.txt index 7c8bfc11cd..05f227a390 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64a35b175d7f7ebc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64a35b175d7f7ebc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64a62c4ab79a9392.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64a62c4ab79a9392.verified.txt index fce8fe7745..176afb27d5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64a62c4ab79a9392.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_64a62c4ab79a9392.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65038f18d261e3bd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65038f18d261e3bd.verified.txt index 0390a552a1..a216f8e72b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65038f18d261e3bd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65038f18d261e3bd.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_651585a49f15ad93.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_651585a49f15ad93.verified.txt index 5d34eb961a..3f0d8a5d63 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_651585a49f15ad93.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_651585a49f15ad93.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65239be7d65684a5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65239be7d65684a5.verified.txt index 85e08c996c..616d00dad3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65239be7d65684a5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65239be7d65684a5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65759bfe64e6cb7b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65759bfe64e6cb7b.verified.txt index 59b6df5191..568ce5851b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65759bfe64e6cb7b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65759bfe64e6cb7b.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65a095141c2b0327.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65a095141c2b0327.verified.txt index 4802fc70a7..11829d17f0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65a095141c2b0327.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65a095141c2b0327.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65ca3b147ffab1b8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65ca3b147ffab1b8.verified.txt index 7aa75b9167..372ce30982 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65ca3b147ffab1b8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65ca3b147ffab1b8.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65f750d6ebb96a9b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65f750d6ebb96a9b.verified.txt index 7c16e27dd0..0b32bc9420 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65f750d6ebb96a9b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_65f750d6ebb96a9b.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6622e6898bd2a60c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6622e6898bd2a60c.verified.txt index 446cc19580..a25fa3cc16 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6622e6898bd2a60c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6622e6898bd2a60c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_66503a7931701755.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_66503a7931701755.verified.txt index 6011762fdb..2b1fea7dd5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_66503a7931701755.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_66503a7931701755.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_669b65892cf5fabe.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_669b65892cf5fabe.verified.txt index 3a0d2e4a54..9336852cb0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_669b65892cf5fabe.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_669b65892cf5fabe.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_66c9a595c22a237f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_66c9a595c22a237f.verified.txt index 07f49dfb53..4b4c1d3914 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_66c9a595c22a237f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_66c9a595c22a237f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_670ab20cc57d42b1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_670ab20cc57d42b1.verified.txt index 991c8156c2..13009bc019 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_670ab20cc57d42b1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_670ab20cc57d42b1.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_670bc0a52047edef.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_670bc0a52047edef.verified.txt index e87dc1c4de..eb4d47b99b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_670bc0a52047edef.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_670bc0a52047edef.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_672b95c1dbc627e7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_672b95c1dbc627e7.verified.txt index 93afbfa313..dc23286667 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_672b95c1dbc627e7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_672b95c1dbc627e7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_672bd4669fd59744.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_672bd4669fd59744.verified.txt index ed5f1e436b..cf75acf712 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_672bd4669fd59744.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_672bd4669fd59744.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_67ebb6544fe6c27f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_67ebb6544fe6c27f.verified.txt index 37deaa77a8..e80a62ce01 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_67ebb6544fe6c27f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_67ebb6544fe6c27f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_67fcf919d818990e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_67fcf919d818990e.verified.txt index 2a1fad4117..399f00b474 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_67fcf919d818990e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_67fcf919d818990e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_68361028fcc5b28d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_68361028fcc5b28d.verified.txt index 39dbcbcf94..83f506894c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_68361028fcc5b28d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_68361028fcc5b28d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_685a015000e838ff.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_685a015000e838ff.verified.txt index 41c1fe8a2d..375ff6b79c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_685a015000e838ff.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_685a015000e838ff.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_697df73dace36249.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_697df73dace36249.verified.txt index 448b646154..4c896dd856 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_697df73dace36249.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_697df73dace36249.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69c9a47cf814b2ec.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69c9a47cf814b2ec.verified.txt index 322d607ed2..7ec4a2617a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69c9a47cf814b2ec.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69c9a47cf814b2ec.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69fc2f9aed9bdedb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69fc2f9aed9bdedb.verified.txt index d0185ef59f..d916d76abb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69fc2f9aed9bdedb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69fc2f9aed9bdedb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69fcd2606de7a2ef.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69fcd2606de7a2ef.verified.txt index 21dea2afc0..ea2bc380f9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69fcd2606de7a2ef.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_69fcd2606de7a2ef.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a3161ca50c7bbf6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a3161ca50c7bbf6.verified.txt index e9eac90898..323ffd99f7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a3161ca50c7bbf6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a3161ca50c7bbf6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a3fa153ba2f58c4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a3fa153ba2f58c4.verified.txt index ffdf0faab3..35324bab7c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a3fa153ba2f58c4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a3fa153ba2f58c4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a4b03c335da7014.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a4b03c335da7014.verified.txt index af00f83026..8efba39113 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a4b03c335da7014.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6a4b03c335da7014.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ac53561d91a91d8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ac53561d91a91d8.verified.txt index da4d25ea33..61ddae596b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ac53561d91a91d8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ac53561d91a91d8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6aec4b1979c2a7a1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6aec4b1979c2a7a1.verified.txt index 155908ef21..fe04334b6f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6aec4b1979c2a7a1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6aec4b1979c2a7a1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6af92539ef70b33c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6af92539ef70b33c.verified.txt index ea24a6a19f..1beb725cc1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6af92539ef70b33c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6af92539ef70b33c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b0a6ed8147cbfdb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b0a6ed8147cbfdb.verified.txt index 0e56d4634b..ab5af7d7d0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b0a6ed8147cbfdb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b0a6ed8147cbfdb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b4e57cec8ffb63e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b4e57cec8ffb63e.verified.txt index 5e1734d136..6f4c30b1a5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b4e57cec8ffb63e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b4e57cec8ffb63e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b8c42be7ead2777.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b8c42be7ead2777.verified.txt index a081283510..46910f76d3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b8c42be7ead2777.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b8c42be7ead2777.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b8fd5857fb466ea.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b8fd5857fb466ea.verified.txt index e83556b535..af7164fc5e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b8fd5857fb466ea.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b8fd5857fb466ea.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b93f58a6c8e2866.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b93f58a6c8e2866.verified.txt index 289515ae85..6866344e3b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b93f58a6c8e2866.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b93f58a6c8e2866.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b980c0ab9b89786.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b980c0ab9b89786.verified.txt index efd21c8683..cfad56583c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b980c0ab9b89786.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6b980c0ab9b89786.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6bd32dd61fdd73d2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6bd32dd61fdd73d2.verified.txt index 608d419b8e..383e335b7a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6bd32dd61fdd73d2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6bd32dd61fdd73d2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6bedde57d52182e1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6bedde57d52182e1.verified.txt index 859efff84d..4a2588e627 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6bedde57d52182e1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6bedde57d52182e1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c198b9ba248881a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c198b9ba248881a.verified.txt index 408c15fe4b..d6e30f2cbd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c198b9ba248881a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c198b9ba248881a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c3acf48437f4941.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c3acf48437f4941.verified.txt index d15f08506a..236e6ce76c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c3acf48437f4941.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c3acf48437f4941.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c472d2da5a96300.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c472d2da5a96300.verified.txt index c7a5ca854c..2a88f1e643 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c472d2da5a96300.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6c472d2da5a96300.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ced1bfee9bf22da.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ced1bfee9bf22da.verified.txt index d1f8d38f43..fec78e16da 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ced1bfee9bf22da.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ced1bfee9bf22da.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d37bb9cc47b1d49.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d37bb9cc47b1d49.verified.txt index 614fedc102..403cd0fb06 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d37bb9cc47b1d49.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d37bb9cc47b1d49.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d5693865c2b8d58.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d5693865c2b8d58.verified.txt index 0217cc5799..3bd8e8c41f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d5693865c2b8d58.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d5693865c2b8d58.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d5873dfe2f4e82b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d5873dfe2f4e82b.verified.txt index ae6c499831..dae977ad07 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d5873dfe2f4e82b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d5873dfe2f4e82b.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d755d73435de6db.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d755d73435de6db.verified.txt index 1a48f32022..210fecccae 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d755d73435de6db.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6d755d73435de6db.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6e35012a7294be15.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6e35012a7294be15.verified.txt index ffe4468de0..6bcfee0217 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6e35012a7294be15.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6e35012a7294be15.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6e75a3328c558a1a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6e75a3328c558a1a.verified.txt index 743e092d20..9ecd94584a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6e75a3328c558a1a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6e75a3328c558a1a.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ec01b6cd0f12ee2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ec01b6cd0f12ee2.verified.txt index 08e55dcccd..7bf2482af3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ec01b6cd0f12ee2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ec01b6cd0f12ee2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ecf9d4c2948b0ee.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ecf9d4c2948b0ee.verified.txt index 3314ccf199..837093949c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ecf9d4c2948b0ee.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6ecf9d4c2948b0ee.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6edc0e333d7ca95b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6edc0e333d7ca95b.verified.txt index c945a0d63b..edf3ec62e3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6edc0e333d7ca95b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_6edc0e333d7ca95b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7004a328de2e0ca3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7004a328de2e0ca3.verified.txt index 20adb6b32d..7fd7789220 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7004a328de2e0ca3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7004a328de2e0ca3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_702f21c7445d42d4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_702f21c7445d42d4.verified.txt index 5c78b39e8c..212cf0963b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_702f21c7445d42d4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_702f21c7445d42d4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_707e1d37084242f9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_707e1d37084242f9.verified.txt index 40f3468d98..721cb20747 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_707e1d37084242f9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_707e1d37084242f9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_70ac68ef35e988a5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_70ac68ef35e988a5.verified.txt index 07209a11ab..ffc40d8ef7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_70ac68ef35e988a5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_70ac68ef35e988a5.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_70f6d6cb63867d5a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_70f6d6cb63867d5a.verified.txt index b7e05fc9ed..020e7024a2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_70f6d6cb63867d5a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_70f6d6cb63867d5a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_71145c65a5055538.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_71145c65a5055538.verified.txt index a5ae418432..044f94f9c2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_71145c65a5055538.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_71145c65a5055538.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_719bcbcfd10c3314.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_719bcbcfd10c3314.verified.txt index cc0c3d1c47..f5260b4043 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_719bcbcfd10c3314.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_719bcbcfd10c3314.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_71e47d4e15567da6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_71e47d4e15567da6.verified.txt index b3a7620836..fa620f7d79 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_71e47d4e15567da6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_71e47d4e15567da6.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7256eca2416a2091.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7256eca2416a2091.verified.txt index a0c5d55798..7eed751201 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7256eca2416a2091.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7256eca2416a2091.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7258f6be8e2c828d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7258f6be8e2c828d.verified.txt index 65fc7078eb..2e22de5e63 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7258f6be8e2c828d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7258f6be8e2c828d.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_726f57746ba1cb7a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_726f57746ba1cb7a.verified.txt index a7a0a75331..f90c6806cf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_726f57746ba1cb7a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_726f57746ba1cb7a.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72b0cb9c39c87b63.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72b0cb9c39c87b63.verified.txt index e25033e838..af78b0732f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72b0cb9c39c87b63.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72b0cb9c39c87b63.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72d2b1e76f447645.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72d2b1e76f447645.verified.txt index 24b3f58b18..e327efd6e5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72d2b1e76f447645.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72d2b1e76f447645.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72fd6e0d4ddc0d3f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72fd6e0d4ddc0d3f.verified.txt index 4be9cb965e..5a7d28ed24 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72fd6e0d4ddc0d3f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_72fd6e0d4ddc0d3f.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_731d2ef406a0d5f5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_731d2ef406a0d5f5.verified.txt index eb456299f9..cb35d30416 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_731d2ef406a0d5f5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_731d2ef406a0d5f5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_734f1d13b7cdbc1b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_734f1d13b7cdbc1b.verified.txt index c3e7377fa2..f5977ff54f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_734f1d13b7cdbc1b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_734f1d13b7cdbc1b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73804adbc23469d8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73804adbc23469d8.verified.txt index 20daa3aa8a..8d9f1e09b9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73804adbc23469d8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73804adbc23469d8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73a90dc69fec0a55.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73a90dc69fec0a55.verified.txt index fd9bebfda3..203dd6b0a4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73a90dc69fec0a55.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73a90dc69fec0a55.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73b50d03548740d0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73b50d03548740d0.verified.txt index 4983c4823c..72cd766846 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73b50d03548740d0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73b50d03548740d0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73bbd244c82ae3fd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73bbd244c82ae3fd.verified.txt index 342dbd0e12..8b80d5ec90 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73bbd244c82ae3fd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73bbd244c82ae3fd.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73c2839e94370620.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73c2839e94370620.verified.txt index 29f647e197..8d29e23162 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73c2839e94370620.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73c2839e94370620.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73c81238365479f6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73c81238365479f6.verified.txt index 53532c2787..4c8a56905d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73c81238365479f6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_73c81238365479f6.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7477ee6a9922c434.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7477ee6a9922c434.verified.txt index 39226fab24..5d565437eb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7477ee6a9922c434.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7477ee6a9922c434.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_748901131c830f2a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_748901131c830f2a.verified.txt index cfb78afbda..3902560ab9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_748901131c830f2a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_748901131c830f2a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_748e699d4c94c206.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_748e699d4c94c206.verified.txt index bfb80b6058..2dcb5faa38 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_748e699d4c94c206.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_748e699d4c94c206.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_749518a425a23a07.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_749518a425a23a07.verified.txt index 1ad157a09f..a4e115347c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_749518a425a23a07.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_749518a425a23a07.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7495272485356f8c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7495272485356f8c.verified.txt index f42944d53a..4efc476493 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7495272485356f8c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7495272485356f8c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_74a812b979852e89.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_74a812b979852e89.verified.txt index 3e051bcf22..78cd65b465 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_74a812b979852e89.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_74a812b979852e89.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_74f28d1e19ca5b74.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_74f28d1e19ca5b74.verified.txt index f7af3a8e51..acccff0a0f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_74f28d1e19ca5b74.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_74f28d1e19ca5b74.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_752db732ecb59b58.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_752db732ecb59b58.verified.txt index 4dd840dce9..3f2b6d53fc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_752db732ecb59b58.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_752db732ecb59b58.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7560eef87cd7423e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7560eef87cd7423e.verified.txt index 46ba0c63d9..4d1df8ff20 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7560eef87cd7423e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7560eef87cd7423e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_756ed6c87d399e54.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_756ed6c87d399e54.verified.txt index 4c8b9e0fe0..95082f69c9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_756ed6c87d399e54.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_756ed6c87d399e54.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_75d3e924cfc2a977.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_75d3e924cfc2a977.verified.txt index cd1d8c98aa..c823910a35 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_75d3e924cfc2a977.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_75d3e924cfc2a977.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7610949817c70349.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7610949817c70349.verified.txt index b9ca2812d9..d700a9fee7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7610949817c70349.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7610949817c70349.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76181d327aae1095.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76181d327aae1095.verified.txt index 9fc5227bb5..ea992f8b39 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76181d327aae1095.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76181d327aae1095.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_767903a02e8d245b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_767903a02e8d245b.verified.txt index 50fd4966ce..48df6b146f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_767903a02e8d245b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_767903a02e8d245b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_768143ea278759b2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_768143ea278759b2.verified.txt index 9321bb190b..e5509a72ba 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_768143ea278759b2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_768143ea278759b2.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76ccb3657e3f1344.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76ccb3657e3f1344.verified.txt index 0d9488abda..6a032a63ac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76ccb3657e3f1344.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76ccb3657e3f1344.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76f4f8df0b31dadb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76f4f8df0b31dadb.verified.txt index 5aabc1dcbe..99185dd2ad 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76f4f8df0b31dadb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_76f4f8df0b31dadb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_770f932096d7e999.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_770f932096d7e999.verified.txt index 040234a92a..cb4d735557 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_770f932096d7e999.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_770f932096d7e999.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_776377d1c302c535.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_776377d1c302c535.verified.txt index c401ede104..ec20f1eb77 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_776377d1c302c535.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_776377d1c302c535.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77a1076f1ca4b706.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77a1076f1ca4b706.verified.txt index 91da250a34..5bd4831fe4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77a1076f1ca4b706.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77a1076f1ca4b706.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77e34035d0f5dada.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77e34035d0f5dada.verified.txt index c11d7a30b2..93814b5790 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77e34035d0f5dada.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77e34035d0f5dada.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77e93d2871a14998.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77e93d2871a14998.verified.txt index 1bc9b852b7..c5e4f0c65b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77e93d2871a14998.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_77e93d2871a14998.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_780d0bcf92b7fd1b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_780d0bcf92b7fd1b.verified.txt index 320d3a2288..acf3714d2a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_780d0bcf92b7fd1b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_780d0bcf92b7fd1b.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7841cd14d87aa180.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7841cd14d87aa180.verified.txt index 0ba38dcb39..55f81b7d62 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7841cd14d87aa180.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7841cd14d87aa180.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_784962401092a09f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_784962401092a09f.verified.txt index 4870687472..60d04ce01c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_784962401092a09f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_784962401092a09f.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_785549e5f37cdc28.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_785549e5f37cdc28.verified.txt index 24728970a6..24717a11dd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_785549e5f37cdc28.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_785549e5f37cdc28.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_787f97f09fcd6848.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_787f97f09fcd6848.verified.txt index bfa472e8fc..be2db10662 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_787f97f09fcd6848.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_787f97f09fcd6848.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_78bdba894c070386.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_78bdba894c070386.verified.txt index 0a2e79b5c8..5045e014ff 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_78bdba894c070386.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_78bdba894c070386.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7928d0dcf2a2297e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7928d0dcf2a2297e.verified.txt index a3bfe2a961..2254b32444 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7928d0dcf2a2297e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7928d0dcf2a2297e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_799de54ca22aa3e3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_799de54ca22aa3e3.verified.txt index 7b71e31a9e..ef4f2c3437 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_799de54ca22aa3e3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_799de54ca22aa3e3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_79cc52cbd2abcc8a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_79cc52cbd2abcc8a.verified.txt index 3f2232c9e6..d8c46be389 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_79cc52cbd2abcc8a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_79cc52cbd2abcc8a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_79d519b5e1f98552.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_79d519b5e1f98552.verified.txt index 39e985f996..8c3107ff0a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_79d519b5e1f98552.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_79d519b5e1f98552.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a0d05a9249b753c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a0d05a9249b753c.verified.txt index 03948f8f48..2b089e8049 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a0d05a9249b753c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a0d05a9249b753c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a29b132ef13465c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a29b132ef13465c.verified.txt index 8aef90bc3a..66129dd989 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a29b132ef13465c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a29b132ef13465c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a34ee79c5d57b5e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a34ee79c5d57b5e.verified.txt index 3095d74920..4c82703d8f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a34ee79c5d57b5e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a34ee79c5d57b5e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a50710f3a13ffbe.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a50710f3a13ffbe.verified.txt index 442576bb4e..3557188151 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a50710f3a13ffbe.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7a50710f3a13ffbe.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7afee78a76f51876.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7afee78a76f51876.verified.txt index 144291ef40..77dce4fceb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7afee78a76f51876.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7afee78a76f51876.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7b4eb80c645cf2f5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7b4eb80c645cf2f5.verified.txt index a88e2beb4f..33de7a3075 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7b4eb80c645cf2f5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7b4eb80c645cf2f5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7bbe9bb95d8a8d38.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7bbe9bb95d8a8d38.verified.txt index 8ecb57c19f..6bea77daf4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7bbe9bb95d8a8d38.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7bbe9bb95d8a8d38.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7be5b701649dc247.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7be5b701649dc247.verified.txt index 13f9c64716..0f959a83ee 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7be5b701649dc247.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7be5b701649dc247.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7c1c0bf2f29e0c88.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7c1c0bf2f29e0c88.verified.txt index 489574050a..152326e94e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7c1c0bf2f29e0c88.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7c1c0bf2f29e0c88.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d0d1eda7ed7a804.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d0d1eda7ed7a804.verified.txt index c82c68fd87..df15ad58a4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d0d1eda7ed7a804.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d0d1eda7ed7a804.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d3904d3efa1714e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d3904d3efa1714e.verified.txt index 56061bda3a..510a140d03 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d3904d3efa1714e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d3904d3efa1714e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d920e8e8c4b8f87.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d920e8e8c4b8f87.verified.txt index 696a811e57..85d69433bc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d920e8e8c4b8f87.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7d920e8e8c4b8f87.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7da06f0d215a684c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7da06f0d215a684c.verified.txt index 1f8f7f133a..662f797880 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7da06f0d215a684c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7da06f0d215a684c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7da2f0d86c94c2ae.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7da2f0d86c94c2ae.verified.txt index c6221c2ffa..75419a97bb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7da2f0d86c94c2ae.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7da2f0d86c94c2ae.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7dbe84c313bbb914.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7dbe84c313bbb914.verified.txt index 3d0c0baae8..6548fb2b61 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7dbe84c313bbb914.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7dbe84c313bbb914.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7dc347eff85838e2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7dc347eff85838e2.verified.txt index 7176dbdb16..548eb6712a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7dc347eff85838e2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7dc347eff85838e2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e06e5288ec02523.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e06e5288ec02523.verified.txt index 1ab5e9799e..e42a51bb5c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e06e5288ec02523.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e06e5288ec02523.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e3816db922bc9a4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e3816db922bc9a4.verified.txt index d9726d0840..ba0dc23692 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e3816db922bc9a4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e3816db922bc9a4.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e488a7122cbf00f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e488a7122cbf00f.verified.txt index 1680f209fa..3ce7fb6e25 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e488a7122cbf00f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e488a7122cbf00f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e9392cefb2ad327.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e9392cefb2ad327.verified.txt index cee247dded..a7b55d3064 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e9392cefb2ad327.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7e9392cefb2ad327.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7eb7720a6b8de284.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7eb7720a6b8de284.verified.txt index 837c9f0cf0..502ae0239a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7eb7720a6b8de284.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7eb7720a6b8de284.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7ec18e2d00093057.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7ec18e2d00093057.verified.txt index 7cf016318a..bfb9ec0928 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7ec18e2d00093057.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7ec18e2d00093057.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7eceeee16efad14e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7eceeee16efad14e.verified.txt index e062056d12..907111adbc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7eceeee16efad14e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7eceeee16efad14e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7ee4864d34f0da96.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7ee4864d34f0da96.verified.txt index a406fa5ec0..256708f36e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7ee4864d34f0da96.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7ee4864d34f0da96.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7f4f0f13e9930623.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7f4f0f13e9930623.verified.txt index 451ff7761d..26cccea9ab 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7f4f0f13e9930623.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7f4f0f13e9930623.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fa36e846a272422.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fa36e846a272422.verified.txt index 172c82ffe9..66d2c6e1cd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fa36e846a272422.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fa36e846a272422.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fa89b333b44720c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fa89b333b44720c.verified.txt index 82156398ab..f32cfb2e4d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fa89b333b44720c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fa89b333b44720c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fb8a49d4f184ea8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fb8a49d4f184ea8.verified.txt index 59deadd4f8..f8a4ebd77c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fb8a49d4f184ea8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_7fb8a49d4f184ea8.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_802ab878f0a204c4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_802ab878f0a204c4.verified.txt index 6b1f2cda11..378b13b626 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_802ab878f0a204c4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_802ab878f0a204c4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8043c15316a12438.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8043c15316a12438.verified.txt index 5b189f259d..d6f8338d9b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8043c15316a12438.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8043c15316a12438.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8096173cf4c10c7b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8096173cf4c10c7b.verified.txt index 24d3ff8376..1cb557e594 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8096173cf4c10c7b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8096173cf4c10c7b.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_80acfbba302d8f6f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_80acfbba302d8f6f.verified.txt index 26bf599bde..731a247dd7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_80acfbba302d8f6f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_80acfbba302d8f6f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_80d524b67e8349db.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_80d524b67e8349db.verified.txt index 83f07c529e..bf8dcec700 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_80d524b67e8349db.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_80d524b67e8349db.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_813e03ed99a26522.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_813e03ed99a26522.verified.txt index 3c7e394dae..fea79fbda5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_813e03ed99a26522.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_813e03ed99a26522.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_815378d5348cacf1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_815378d5348cacf1.verified.txt index 37ba0c92e8..8954f1f570 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_815378d5348cacf1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_815378d5348cacf1.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_819f01ba9311fa18.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_819f01ba9311fa18.verified.txt index 136d10ce52..b44afbb53c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_819f01ba9311fa18.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_819f01ba9311fa18.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81bd438b544b74bd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81bd438b544b74bd.verified.txt index e552399120..547eb99a91 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81bd438b544b74bd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81bd438b544b74bd.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81eb306e4b98152e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81eb306e4b98152e.verified.txt index c6fe038cbc..890a44a4d5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81eb306e4b98152e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81eb306e4b98152e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81ec725790703699.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81ec725790703699.verified.txt index 3169119e51..508af94b87 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81ec725790703699.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_81ec725790703699.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_821b31527cb7ec1c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_821b31527cb7ec1c.verified.txt index 0c0189f102..52ca01e5e5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_821b31527cb7ec1c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_821b31527cb7ec1c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8236af6b8373721b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8236af6b8373721b.verified.txt index 5f6b177327..97c8078877 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8236af6b8373721b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8236af6b8373721b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8256717e1a136692.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8256717e1a136692.verified.txt index 40bae701ad..233ee4f445 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8256717e1a136692.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8256717e1a136692.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_82bbf1a8e6286b89.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_82bbf1a8e6286b89.verified.txt index bd9b45ce8b..4a415337e5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_82bbf1a8e6286b89.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_82bbf1a8e6286b89.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_830785d672195aa0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_830785d672195aa0.verified.txt index d55b1ecae5..867a7f80ba 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_830785d672195aa0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_830785d672195aa0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_834310c7fc35f23c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_834310c7fc35f23c.verified.txt index 715246ca51..7bb4431bfc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_834310c7fc35f23c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_834310c7fc35f23c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_839f146f1f186c59.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_839f146f1f186c59.verified.txt index 68286828c9..fd38b40ae0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_839f146f1f186c59.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_839f146f1f186c59.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_83e3bd62e794f223.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_83e3bd62e794f223.verified.txt index d551ce0b7c..eafd5d163d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_83e3bd62e794f223.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_83e3bd62e794f223.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_83eafcb2c525d88c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_83eafcb2c525d88c.verified.txt index 3cf81c0a78..5906cabbda 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_83eafcb2c525d88c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_83eafcb2c525d88c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8443e155374600d9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8443e155374600d9.verified.txt index a3961db406..1e3f9c8f20 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8443e155374600d9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8443e155374600d9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84569435b095aae7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84569435b095aae7.verified.txt index 7845eef874..14fdfacc2f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84569435b095aae7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84569435b095aae7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84cae70ff1e36dc6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84cae70ff1e36dc6.verified.txt index 28cf4601d3..58440ec02e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84cae70ff1e36dc6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84cae70ff1e36dc6.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84d05a2a0923bd6d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84d05a2a0923bd6d.verified.txt index 996b844058..6d3251016a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84d05a2a0923bd6d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84d05a2a0923bd6d.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84e052b9b15a4dc3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84e052b9b15a4dc3.verified.txt index fbcbdf5350..c8949f69a8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84e052b9b15a4dc3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_84e052b9b15a4dc3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_851ae6b0eb11f8cc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_851ae6b0eb11f8cc.verified.txt index d865246c33..c99501f8b8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_851ae6b0eb11f8cc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_851ae6b0eb11f8cc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_852291cb63a71e2e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_852291cb63a71e2e.verified.txt index d2216823e8..96d1278c73 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_852291cb63a71e2e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_852291cb63a71e2e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85431e6f878152aa.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85431e6f878152aa.verified.txt index 8f10a1f3e8..233a7e0ce3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85431e6f878152aa.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85431e6f878152aa.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8543931d8271ea03.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8543931d8271ea03.verified.txt index 78af83641d..cee303971c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8543931d8271ea03.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8543931d8271ea03.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_857a000b885935fa.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_857a000b885935fa.verified.txt index 8ccba130d7..401fb10422 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_857a000b885935fa.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_857a000b885935fa.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85ae57892966d4ff.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85ae57892966d4ff.verified.txt index 2d945ea2cc..54d13476b2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85ae57892966d4ff.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85ae57892966d4ff.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85b94a1ee11fd4e5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85b94a1ee11fd4e5.verified.txt index 16fe05fff6..79a00ae2f6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85b94a1ee11fd4e5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85b94a1ee11fd4e5.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85bdda0834299bf7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85bdda0834299bf7.verified.txt index 995c1a9801..ef17ab61fe 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85bdda0834299bf7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85bdda0834299bf7.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85f8eafe9d8ea985.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85f8eafe9d8ea985.verified.txt index f45926d033..974fba1ba7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85f8eafe9d8ea985.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_85f8eafe9d8ea985.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_860dc6192199ac6e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_860dc6192199ac6e.verified.txt index 56779e52c0..abdd0d2536 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_860dc6192199ac6e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_860dc6192199ac6e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86105943e84e847f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86105943e84e847f.verified.txt index 16ef61889b..fd5e2fdc93 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86105943e84e847f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86105943e84e847f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8639e20bf634e23a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8639e20bf634e23a.verified.txt index 2177f49fea..11820da3e2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8639e20bf634e23a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8639e20bf634e23a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_864f2e0953315b38.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_864f2e0953315b38.verified.txt index 8b453905e6..de91cf32f1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_864f2e0953315b38.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_864f2e0953315b38.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8655bfa3b8992c7c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8655bfa3b8992c7c.verified.txt index 8eeeb4d31f..ee04fe2a11 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8655bfa3b8992c7c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8655bfa3b8992c7c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_866d8182e8bb23a1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_866d8182e8bb23a1.verified.txt index b02104ed7e..63bec687ad 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_866d8182e8bb23a1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_866d8182e8bb23a1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86bf83c0066c558e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86bf83c0066c558e.verified.txt index 3bd3daf1fa..c81586ed3b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86bf83c0066c558e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86bf83c0066c558e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86fc6d2ce139945a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86fc6d2ce139945a.verified.txt index bd2e98c707..488fa3591e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86fc6d2ce139945a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_86fc6d2ce139945a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_871884b6ce15140e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_871884b6ce15140e.verified.txt index 6f00d8384a..f32d982b41 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_871884b6ce15140e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_871884b6ce15140e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_875b5dbafedda1c9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_875b5dbafedda1c9.verified.txt index 49f5b18a5d..2c529f2ef0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_875b5dbafedda1c9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_875b5dbafedda1c9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_87d6cabd2c87c4d8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_87d6cabd2c87c4d8.verified.txt index 5aa6291f46..5c142bdd95 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_87d6cabd2c87c4d8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_87d6cabd2c87c4d8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_883c9503e927010c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_883c9503e927010c.verified.txt index 8fe774a1e6..67e969e441 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_883c9503e927010c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_883c9503e927010c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8857c1803dc1266f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8857c1803dc1266f.verified.txt index 990607135e..fcb49d9350 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8857c1803dc1266f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8857c1803dc1266f.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_888520bd04bba958.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_888520bd04bba958.verified.txt index 7d432fff5b..92a76d0ec2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_888520bd04bba958.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_888520bd04bba958.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8891571acc26682e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8891571acc26682e.verified.txt index 48574cb619..405f9915fb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8891571acc26682e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8891571acc26682e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_889eaff9287e3b3a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_889eaff9287e3b3a.verified.txt index b3b173ae06..199e5f1ea8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_889eaff9287e3b3a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_889eaff9287e3b3a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_88a13a408f467096.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_88a13a408f467096.verified.txt index b760bd4bd2..1fbd6e1f04 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_88a13a408f467096.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_88a13a408f467096.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_88af252d3a9520d7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_88af252d3a9520d7.verified.txt index a825f2b193..cf50e8b418 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_88af252d3a9520d7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_88af252d3a9520d7.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_890cc6225e927910.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_890cc6225e927910.verified.txt index 51d33a3dc0..90b0d4cd2b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_890cc6225e927910.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_890cc6225e927910.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_895270e942df83ea.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_895270e942df83ea.verified.txt index f306a62670..f2d2863d96 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_895270e942df83ea.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_895270e942df83ea.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_89bd27009f1555fa.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_89bd27009f1555fa.verified.txt index f03143828f..29d5e4e60a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_89bd27009f1555fa.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_89bd27009f1555fa.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a09228131ea39b9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a09228131ea39b9.verified.txt index 997016ab21..fd438de852 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a09228131ea39b9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a09228131ea39b9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a78c2d195f51c4c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a78c2d195f51c4c.verified.txt index a86d1fa8ff..83f88cc2a1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a78c2d195f51c4c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a78c2d195f51c4c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a9dc423d4ded57b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a9dc423d4ded57b.verified.txt index c24ac542da..3fc2f43ca1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a9dc423d4ded57b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8a9dc423d4ded57b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8aa872f20216b6b1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8aa872f20216b6b1.verified.txt index dc497b6295..d111566680 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8aa872f20216b6b1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8aa872f20216b6b1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b225313a032ee08.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b225313a032ee08.verified.txt index 4efb243a61..3ba1287a78 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b225313a032ee08.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b225313a032ee08.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b64a093581255ad.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b64a093581255ad.verified.txt index 8b5b5bac59..bf4d82451d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b64a093581255ad.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b64a093581255ad.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b970bb80581f61a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b970bb80581f61a.verified.txt index c80bf98d6e..fcfcf5b753 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b970bb80581f61a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8b970bb80581f61a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8bb4743f348362af.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8bb4743f348362af.verified.txt index 627ebb8942..b910cfd4bb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8bb4743f348362af.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8bb4743f348362af.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8bc1ad81347d3c4e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8bc1ad81347d3c4e.verified.txt index 4736f1e8d7..56c685b3f9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8bc1ad81347d3c4e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8bc1ad81347d3c4e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8c0f79f239648767.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8c0f79f239648767.verified.txt index 835f604652..86a3f60f6a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8c0f79f239648767.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8c0f79f239648767.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8cba5794f0652371.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8cba5794f0652371.verified.txt index 1eb5c62aaf..67b017630d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8cba5794f0652371.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8cba5794f0652371.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8ccc88fe6029a891.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8ccc88fe6029a891.verified.txt index f25afc6546..a2e3a2c0a2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8ccc88fe6029a891.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8ccc88fe6029a891.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8ce699b98d2a9700.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8ce699b98d2a9700.verified.txt index 29cd5d268b..088c584f19 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8ce699b98d2a9700.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8ce699b98d2a9700.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8cfed8dcf1321694.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8cfed8dcf1321694.verified.txt index ef0a1708a4..21f68632ba 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8cfed8dcf1321694.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8cfed8dcf1321694.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8d28ef5759f40ab9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8d28ef5759f40ab9.verified.txt index af13862899..fefa8cf62a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8d28ef5759f40ab9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8d28ef5759f40ab9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8dbfe96c5dd947fe.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8dbfe96c5dd947fe.verified.txt index 868b4b5f85..e6f220110a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8dbfe96c5dd947fe.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8dbfe96c5dd947fe.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8df3b73bea61f818.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8df3b73bea61f818.verified.txt index 8462584d4b..0c224ac7eb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8df3b73bea61f818.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8df3b73bea61f818.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e3fcc91e2f6ee7a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e3fcc91e2f6ee7a.verified.txt index 627534af3b..a37ef16b8f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e3fcc91e2f6ee7a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e3fcc91e2f6ee7a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e70c4ca896bf455.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e70c4ca896bf455.verified.txt index edcfeed35d..fcc52021e6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e70c4ca896bf455.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e70c4ca896bf455.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e93f50ead8fda3d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e93f50ead8fda3d.verified.txt index 00242f9dd2..a522567066 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e93f50ead8fda3d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8e93f50ead8fda3d.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8eb5d8dd036bcc0a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8eb5d8dd036bcc0a.verified.txt index 0da0772dcf..2b814688b7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8eb5d8dd036bcc0a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8eb5d8dd036bcc0a.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8eb66257e6eb852e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8eb66257e6eb852e.verified.txt index 8febdfdd15..3059a6d2da 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8eb66257e6eb852e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8eb66257e6eb852e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f00974a4747fae2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f00974a4747fae2.verified.txt index 45003cd9b3..d77bc486c0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f00974a4747fae2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f00974a4747fae2.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f4c45a11636deac.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f4c45a11636deac.verified.txt index f790ecabc7..86dac89ae0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f4c45a11636deac.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f4c45a11636deac.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f54cd21a7daf71e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f54cd21a7daf71e.verified.txt index a9ec463e5f..6b84076171 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f54cd21a7daf71e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8f54cd21a7daf71e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8fcfc0c8b3391054.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8fcfc0c8b3391054.verified.txt index 3a18c9f690..c3d723a7cf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8fcfc0c8b3391054.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8fcfc0c8b3391054.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8fd9804f5bd26a45.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8fd9804f5bd26a45.verified.txt index 0b67e6b22c..6f75b71617 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8fd9804f5bd26a45.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_8fd9804f5bd26a45.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_900dc8e2556d6efc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_900dc8e2556d6efc.verified.txt index c61f863231..1fe191c612 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_900dc8e2556d6efc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_900dc8e2556d6efc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90266d08324a2d4a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90266d08324a2d4a.verified.txt index d808438709..05f8a067e8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90266d08324a2d4a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90266d08324a2d4a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90c7d4310f2e0896.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90c7d4310f2e0896.verified.txt index 727a4f511f..54f3fb8bfe 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90c7d4310f2e0896.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90c7d4310f2e0896.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90e1be6de9347b30.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90e1be6de9347b30.verified.txt index d8db36053f..58c7c835be 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90e1be6de9347b30.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90e1be6de9347b30.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90efdf9b0482da54.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90efdf9b0482da54.verified.txt index 8f857adaed..4f9e70b34d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90efdf9b0482da54.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90efdf9b0482da54.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90f1417ae7ed53de.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90f1417ae7ed53de.verified.txt index 8d511ac3e6..a08bad923c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90f1417ae7ed53de.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_90f1417ae7ed53de.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9154185dd3d11430.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9154185dd3d11430.verified.txt index 551500152a..d246f6184c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9154185dd3d11430.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9154185dd3d11430.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_91990b04953db393.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_91990b04953db393.verified.txt index 038b245f0e..7bee944bf6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_91990b04953db393.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_91990b04953db393.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9200ff452a0795bc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9200ff452a0795bc.verified.txt index a29ba46228..72c5173717 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9200ff452a0795bc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9200ff452a0795bc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_928c9420c1bb63de.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_928c9420c1bb63de.verified.txt index ac9bf939ac..727d85ce8f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_928c9420c1bb63de.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_928c9420c1bb63de.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_92edc4c62e75ebc2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_92edc4c62e75ebc2.verified.txt index b59e951a04..cb4131387d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_92edc4c62e75ebc2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_92edc4c62e75ebc2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9361c21355561fb9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9361c21355561fb9.verified.txt index da51e2e693..98d100b92a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9361c21355561fb9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9361c21355561fb9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_936b2c7a1344cfc3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_936b2c7a1344cfc3.verified.txt index 6c06ca2227..2dbf207f0e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_936b2c7a1344cfc3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_936b2c7a1344cfc3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9373fe3eec50413f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9373fe3eec50413f.verified.txt index 64f4ae7357..625c2efa3a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9373fe3eec50413f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9373fe3eec50413f.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_939a32d6927614d5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_939a32d6927614d5.verified.txt index fbbd0e0793..cbf07a050d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_939a32d6927614d5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_939a32d6927614d5.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_93b9295d7d839d94.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_93b9295d7d839d94.verified.txt index cbe57250e8..514b0761e0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_93b9295d7d839d94.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_93b9295d7d839d94.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_93eac42dcba4c72e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_93eac42dcba4c72e.verified.txt index 6c5b72e726..429be6d4a5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_93eac42dcba4c72e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_93eac42dcba4c72e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_941c98798b13301e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_941c98798b13301e.verified.txt index 22270df3c3..6d6ff7d8d1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_941c98798b13301e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_941c98798b13301e.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_945670831a185c84.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_945670831a185c84.verified.txt index 72f19963fa..5e1857e721 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_945670831a185c84.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_945670831a185c84.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_94709de1c724d2f3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_94709de1c724d2f3.verified.txt index 04fb549973..311adf6ff6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_94709de1c724d2f3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_94709de1c724d2f3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_949f6ff71de084b7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_949f6ff71de084b7.verified.txt index 009e986ce8..ebf722db75 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_949f6ff71de084b7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_949f6ff71de084b7.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_94f79482c4eee122.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_94f79482c4eee122.verified.txt index 166dc26a06..5a8f7a2bdc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_94f79482c4eee122.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_94f79482c4eee122.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95270ecbda245a79.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95270ecbda245a79.verified.txt index 403cadd062..56f5710c62 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95270ecbda245a79.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95270ecbda245a79.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9557425ce6c2b7e1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9557425ce6c2b7e1.verified.txt index 8c294acac4..c3251f381e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9557425ce6c2b7e1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9557425ce6c2b7e1.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_955e251507792531.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_955e251507792531.verified.txt index a2062f7636..c95c6e6e12 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_955e251507792531.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_955e251507792531.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_958fb5f6bad827c7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_958fb5f6bad827c7.verified.txt index 4e79ca9493..df2665b507 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_958fb5f6bad827c7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_958fb5f6bad827c7.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95b436d8d2391460.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95b436d8d2391460.verified.txt index eae8d54bac..e7cd81e766 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95b436d8d2391460.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95b436d8d2391460.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95d56defa642382d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95d56defa642382d.verified.txt index 418fd304e8..c28da2d1d5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95d56defa642382d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_95d56defa642382d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_964221e02460356b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_964221e02460356b.verified.txt index 6a04222dca..07359ee4d9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_964221e02460356b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_964221e02460356b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_966ae614987d6c84.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_966ae614987d6c84.verified.txt index 95d2b23307..13c13d18da 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_966ae614987d6c84.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_966ae614987d6c84.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_966cc3f4037a7751.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_966cc3f4037a7751.verified.txt index 549ff5020d..d00b980669 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_966cc3f4037a7751.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_966cc3f4037a7751.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_96bbfe158b17097f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_96bbfe158b17097f.verified.txt index 537803ae70..c3d650f598 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_96bbfe158b17097f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_96bbfe158b17097f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_96c678b8a7bd5cd7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_96c678b8a7bd5cd7.verified.txt index 6442034110..49623f5350 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_96c678b8a7bd5cd7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_96c678b8a7bd5cd7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97465862faa84c1b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97465862faa84c1b.verified.txt index c639c47e37..b9d841faa8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97465862faa84c1b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97465862faa84c1b.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9758b3c8b77eefc7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9758b3c8b77eefc7.verified.txt index edb3b2c71b..bdb202dbf6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9758b3c8b77eefc7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9758b3c8b77eefc7.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_979f4e1d8778978d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_979f4e1d8778978d.verified.txt index d804844929..6166c12ebe 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_979f4e1d8778978d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_979f4e1d8778978d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97a4b2f2e9d0e8fc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97a4b2f2e9d0e8fc.verified.txt index ccdd9ff184..61724578b0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97a4b2f2e9d0e8fc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97a4b2f2e9d0e8fc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97c94938b29f3cd8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97c94938b29f3cd8.verified.txt index f79f6f55af..e8b7887522 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97c94938b29f3cd8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_97c94938b29f3cd8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9803af96862ec001.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9803af96862ec001.verified.txt index 7c5cd16c40..59f40d4055 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9803af96862ec001.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9803af96862ec001.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_98098a7569a690ed.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_98098a7569a690ed.verified.txt index c75c76b215..28d2150f34 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_98098a7569a690ed.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_98098a7569a690ed.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_981186176ef2ec89.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_981186176ef2ec89.verified.txt index 30b9175321..fd30a45f54 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_981186176ef2ec89.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_981186176ef2ec89.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_982cabb729c12038.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_982cabb729c12038.verified.txt index 634d58bcd2..65fe07fe04 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_982cabb729c12038.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_982cabb729c12038.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_984e86bec72e91b8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_984e86bec72e91b8.verified.txt index efc0bf3ad8..38a1b78d98 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_984e86bec72e91b8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_984e86bec72e91b8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9889b062b29f0e60.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9889b062b29f0e60.verified.txt index 31d8651663..e21ddbc389 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9889b062b29f0e60.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9889b062b29f0e60.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_98f47fdce5a9bb07.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_98f47fdce5a9bb07.verified.txt index 2a81944ce9..5f933fca0e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_98f47fdce5a9bb07.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_98f47fdce5a9bb07.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_992a5a8cdfae182e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_992a5a8cdfae182e.verified.txt index 77db4a9767..d339691edf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_992a5a8cdfae182e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_992a5a8cdfae182e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9961dd976b67edad.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9961dd976b67edad.verified.txt index 55a314809f..be310f99d5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9961dd976b67edad.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9961dd976b67edad.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_99b6279fde80422d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_99b6279fde80422d.verified.txt index c27096150e..f38e84d4a3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_99b6279fde80422d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_99b6279fde80422d.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_99f3ec72142e73ac.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_99f3ec72142e73ac.verified.txt index 2ae8bd90ab..4c6461278a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_99f3ec72142e73ac.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_99f3ec72142e73ac.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a1bd23b384ef683.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a1bd23b384ef683.verified.txt index 54e0ae5700..777b1e88e6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a1bd23b384ef683.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a1bd23b384ef683.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a2d043e82919de6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a2d043e82919de6.verified.txt index 268ae90184..298863a9ac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a2d043e82919de6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a2d043e82919de6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a2e732ed923494c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a2e732ed923494c.verified.txt index 49444983bc..1523245ab6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a2e732ed923494c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9a2e732ed923494c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9abcc5efd6040859.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9abcc5efd6040859.verified.txt index 527bc23f13..8a56c126df 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9abcc5efd6040859.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9abcc5efd6040859.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b405704783b6e4b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b405704783b6e4b.verified.txt index 7c6c6dd6fa..46b1745665 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b405704783b6e4b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b405704783b6e4b.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b5890bfa5b4d99f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b5890bfa5b4d99f.verified.txt index bf896f941c..9d9b5a7117 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b5890bfa5b4d99f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b5890bfa5b4d99f.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b64d988d4d8ce85.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b64d988d4d8ce85.verified.txt index bb5d29d38b..b357aefb0f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b64d988d4d8ce85.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b64d988d4d8ce85.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b84c021f22516d6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b84c021f22516d6.verified.txt index ec18cf0db4..db5465ad82 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b84c021f22516d6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9b84c021f22516d6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9bb22f74e6137ab0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9bb22f74e6137ab0.verified.txt index 0cc1be2d83..6cc8c3b090 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9bb22f74e6137ab0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9bb22f74e6137ab0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c3500a3e611e7b8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c3500a3e611e7b8.verified.txt index 76699b9013..f0d29c34da 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c3500a3e611e7b8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c3500a3e611e7b8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c3a8804609498e0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c3a8804609498e0.verified.txt index f78e2c6abd..ae7a1e541f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c3a8804609498e0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c3a8804609498e0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c4be19559533f56.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c4be19559533f56.verified.txt index 92294674c1..da101481ec 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c4be19559533f56.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c4be19559533f56.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c4f1e5821ac82cb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c4f1e5821ac82cb.verified.txt index 2ce02fdc30..daa9a9d0c8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c4f1e5821ac82cb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c4f1e5821ac82cb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c5059f1c406a6e0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c5059f1c406a6e0.verified.txt index fc399b44b2..d5a84b5758 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c5059f1c406a6e0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c5059f1c406a6e0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c7ddcafcc8e81f2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c7ddcafcc8e81f2.verified.txt index 259ffcbcc0..b50d0d2b00 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c7ddcafcc8e81f2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c7ddcafcc8e81f2.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c9feb793d139c18.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c9feb793d139c18.verified.txt index cc1436be38..2ab1bbbce1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c9feb793d139c18.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9c9feb793d139c18.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cb55c92bb21f55e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cb55c92bb21f55e.verified.txt index 6629bbc44b..c2702886c0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cb55c92bb21f55e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cb55c92bb21f55e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cc462a576f0da80.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cc462a576f0da80.verified.txt index 9f548c8180..9c31978a07 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cc462a576f0da80.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cc462a576f0da80.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cd706d9e2ade979.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cd706d9e2ade979.verified.txt index 811480c303..9ec0b965c0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cd706d9e2ade979.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9cd706d9e2ade979.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d1e362cebedf68b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d1e362cebedf68b.verified.txt index 783571062a..658a5e5c4c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d1e362cebedf68b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d1e362cebedf68b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d2386e4cdf4622c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d2386e4cdf4622c.verified.txt index 8a8f32b312..f48d3b127c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d2386e4cdf4622c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d2386e4cdf4622c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d48fd5d58fbfea2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d48fd5d58fbfea2.verified.txt index 34fa3ae8ec..3b995375a0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d48fd5d58fbfea2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d48fd5d58fbfea2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d632284ed11c729.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d632284ed11c729.verified.txt index 02e3f3baea..d619027c23 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d632284ed11c729.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9d632284ed11c729.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9de9214bc3816f44.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9de9214bc3816f44.verified.txt index 9fdc652455..f26b394f86 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9de9214bc3816f44.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9de9214bc3816f44.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9deeda27f7a8acdf.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9deeda27f7a8acdf.verified.txt index 1fc6b8ff90..d284e1a814 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9deeda27f7a8acdf.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9deeda27f7a8acdf.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9df46a62d35fe8eb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9df46a62d35fe8eb.verified.txt index 71dae415d3..3962c41efb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9df46a62d35fe8eb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9df46a62d35fe8eb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e02aefecac068bb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e02aefecac068bb.verified.txt index 64b709b893..f76fd84e62 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e02aefecac068bb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e02aefecac068bb.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e1d6f77768563a0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e1d6f77768563a0.verified.txt index 4fc509c2c9..8e36257b26 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e1d6f77768563a0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e1d6f77768563a0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e362fba77f22be4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e362fba77f22be4.verified.txt index da1dd0c4e5..bfceb6e432 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e362fba77f22be4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e362fba77f22be4.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e54a35ab1785004.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e54a35ab1785004.verified.txt index c8ce69cbd4..6929ab78f4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e54a35ab1785004.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e54a35ab1785004.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e6bb96518d7a8fd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e6bb96518d7a8fd.verified.txt index 5c9320a832..30c9c479cf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e6bb96518d7a8fd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e6bb96518d7a8fd.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e7f6faafa6e6390.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e7f6faafa6e6390.verified.txt index 88730f0106..bfde25cc5f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e7f6faafa6e6390.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9e7f6faafa6e6390.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9ebef09ef84725e6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9ebef09ef84725e6.verified.txt index e66161a6a1..6dd131cc82 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9ebef09ef84725e6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9ebef09ef84725e6.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9ef49dd99df28fd9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9ef49dd99df28fd9.verified.txt index 08f46e9d30..c5d8438ad3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9ef49dd99df28fd9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9ef49dd99df28fd9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f2636db94a545a7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f2636db94a545a7.verified.txt index bdd19525ca..2cd9defa29 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f2636db94a545a7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f2636db94a545a7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f2aa7b4f6246f6a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f2aa7b4f6246f6a.verified.txt index 576f33afd7..6d9f2f4b81 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f2aa7b4f6246f6a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f2aa7b4f6246f6a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f876f3fa4dc5e75.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f876f3fa4dc5e75.verified.txt index 7ecf6bd385..29ff15979e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f876f3fa4dc5e75.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f876f3fa4dc5e75.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f92a05dc45c7f93.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f92a05dc45c7f93.verified.txt index e005eabe63..eea59fd16f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f92a05dc45c7f93.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f92a05dc45c7f93.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f96079551cd472e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f96079551cd472e.verified.txt index ffda331500..38d1cc74c9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f96079551cd472e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_9f96079551cd472e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a00ac5ce6fc5f2ef.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a00ac5ce6fc5f2ef.verified.txt index 0f14b00086..a04e1c6526 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a00ac5ce6fc5f2ef.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a00ac5ce6fc5f2ef.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a054f29bc225e27f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a054f29bc225e27f.verified.txt index d9d4f20307..0f23136706 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a054f29bc225e27f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a054f29bc225e27f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a090f55e49d78b85.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a090f55e49d78b85.verified.txt index b4dcd754b1..6f4cffb6ab 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a090f55e49d78b85.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a090f55e49d78b85.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a13e4337d80bb601.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a13e4337d80bb601.verified.txt index ed57fec9f4..c3ee8ab22b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a13e4337d80bb601.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a13e4337d80bb601.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a17b315d2138f3a5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a17b315d2138f3a5.verified.txt index 7270e6ef02..b2604e2a9e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a17b315d2138f3a5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a17b315d2138f3a5.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a18ee6a99eb155fb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a18ee6a99eb155fb.verified.txt index 58d751f02d..b0c07fb774 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a18ee6a99eb155fb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a18ee6a99eb155fb.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1b09cc31f803ee4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1b09cc31f803ee4.verified.txt index 56b76ab3ce..dbf526b472 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1b09cc31f803ee4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1b09cc31f803ee4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1d47755ff750dbc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1d47755ff750dbc.verified.txt index e098d8284b..b84e142362 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1d47755ff750dbc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1d47755ff750dbc.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1db8ad08b9c6f0b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1db8ad08b9c6f0b.verified.txt index eab773c83a..abf1564f93 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1db8ad08b9c6f0b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a1db8ad08b9c6f0b.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a20b9596fc19153a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a20b9596fc19153a.verified.txt index 8aea629fef..a6f5683370 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a20b9596fc19153a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a20b9596fc19153a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a21a2853ff5de6d7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a21a2853ff5de6d7.verified.txt index 4178a0991a..6e5fc620c9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a21a2853ff5de6d7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a21a2853ff5de6d7.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a21a9623a129fce8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a21a9623a129fce8.verified.txt index 3b0b9062a2..423de546d1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a21a9623a129fce8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a21a9623a129fce8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a2a185228d8c2e8c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a2a185228d8c2e8c.verified.txt index 337139bc45..42f90a0f87 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a2a185228d8c2e8c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a2a185228d8c2e8c.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a38acb77fada9d38.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a38acb77fada9d38.verified.txt index b854c1ccf9..112c006311 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a38acb77fada9d38.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a38acb77fada9d38.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a39226592ded51a4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a39226592ded51a4.verified.txt index 6f0c0c9639..eb7e7719ac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a39226592ded51a4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a39226592ded51a4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a397c68274cdf9e4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a397c68274cdf9e4.verified.txt index 4c5b3c355a..2e54b164a9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a397c68274cdf9e4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a397c68274cdf9e4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a449e70dc3829b06.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a449e70dc3829b06.verified.txt index b67dd754b4..5c19a0995c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a449e70dc3829b06.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a449e70dc3829b06.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a449efdfb252cc09.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a449efdfb252cc09.verified.txt index c90134241c..ba479e0ec8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a449efdfb252cc09.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a449efdfb252cc09.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a46640b3a2040cbd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a46640b3a2040cbd.verified.txt index 769e929190..005bf71929 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a46640b3a2040cbd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a46640b3a2040cbd.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a487ce53f8fe8e27.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a487ce53f8fe8e27.verified.txt index add2e8596d..7e6d0545d9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a487ce53f8fe8e27.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a487ce53f8fe8e27.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a4a8efb4c0321116.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a4a8efb4c0321116.verified.txt index df88596fac..3c14441215 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a4a8efb4c0321116.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a4a8efb4c0321116.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5279e66910e57f2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5279e66910e57f2.verified.txt index 49876fbc33..5003576da3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5279e66910e57f2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5279e66910e57f2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5285efa9638f31c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5285efa9638f31c.verified.txt index f7c59c4803..2ae609cb5f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5285efa9638f31c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5285efa9638f31c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a54637d80474d1eb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a54637d80474d1eb.verified.txt index 6946937e05..e8cb1d9e19 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a54637d80474d1eb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a54637d80474d1eb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5645dc9376f9cfb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5645dc9376f9cfb.verified.txt index 556ad9e7ba..c942852bfb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5645dc9376f9cfb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5645dc9376f9cfb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5f7c1fc0aa09bb5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5f7c1fc0aa09bb5.verified.txt index 963c265d05..871f953686 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5f7c1fc0aa09bb5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a5f7c1fc0aa09bb5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a60cf74e50ca74ae.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a60cf74e50ca74ae.verified.txt index ca475acae6..ff0d4afc80 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a60cf74e50ca74ae.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a60cf74e50ca74ae.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a60d5d9742196881.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a60d5d9742196881.verified.txt index 0a3c05669f..f51255dabb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a60d5d9742196881.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a60d5d9742196881.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a624efe430e681de.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a624efe430e681de.verified.txt index 408c18bc06..70c5d299ad 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a624efe430e681de.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a624efe430e681de.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a630fbfb7390a72e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a630fbfb7390a72e.verified.txt index bee88854d0..0155f9817d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a630fbfb7390a72e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a630fbfb7390a72e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a66bed7e68fe176a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a66bed7e68fe176a.verified.txt index 9c35946e1e..44697c37d1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a66bed7e68fe176a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a66bed7e68fe176a.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6d206a79c0b11bc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6d206a79c0b11bc.verified.txt index 32ea13ab81..c1742cde1e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6d206a79c0b11bc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6d206a79c0b11bc.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6d238c89c6ed62b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6d238c89c6ed62b.verified.txt index 8ff5273805..684e65a130 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6d238c89c6ed62b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6d238c89c6ed62b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6e13051afa12d80.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6e13051afa12d80.verified.txt index 1116fef231..bca154c2a4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6e13051afa12d80.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6e13051afa12d80.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6edf3b92f83348b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6edf3b92f83348b.verified.txt index f5d052a75e..f3ef09e876 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6edf3b92f83348b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a6edf3b92f83348b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a74ddb475aac1ddd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a74ddb475aac1ddd.verified.txt index 1c09b56bdd..9315dcd929 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a74ddb475aac1ddd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a74ddb475aac1ddd.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a74f1e1358ee2cb8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a74f1e1358ee2cb8.verified.txt index f79e142173..e9477f9c55 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a74f1e1358ee2cb8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a74f1e1358ee2cb8.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a777d74ca0dee686.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a777d74ca0dee686.verified.txt index 35b3aa7993..3079a17ef5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a777d74ca0dee686.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a777d74ca0dee686.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a796842c26dc0675.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a796842c26dc0675.verified.txt index 314eb30376..a9da4351d3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a796842c26dc0675.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a796842c26dc0675.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a7c7eba5ec3f3cd6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a7c7eba5ec3f3cd6.verified.txt index 98fa14286c..eb58d28067 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a7c7eba5ec3f3cd6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a7c7eba5ec3f3cd6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a82f26de8832eccf.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a82f26de8832eccf.verified.txt index 85f85661ac..ffae9985fa 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a82f26de8832eccf.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a82f26de8832eccf.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a8348d8ce5e77a64.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a8348d8ce5e77a64.verified.txt index bb8b57acda..8fb9a09cc8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a8348d8ce5e77a64.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a8348d8ce5e77a64.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a892b9f540fb3fbd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a892b9f540fb3fbd.verified.txt index fb8d2f94a8..e447093d7e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a892b9f540fb3fbd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a892b9f540fb3fbd.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a8e0f89f302cf0ac.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a8e0f89f302cf0ac.verified.txt index 16d5276fc1..daf515fc1d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a8e0f89f302cf0ac.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a8e0f89f302cf0ac.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a92561fae528dd66.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a92561fae528dd66.verified.txt index 0d9dbb6216..081f4d52e4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a92561fae528dd66.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a92561fae528dd66.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9710d6372e0627c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9710d6372e0627c.verified.txt index 29ac2f7bec..ee953aaea3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9710d6372e0627c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9710d6372e0627c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9cce7dd1a7552db.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9cce7dd1a7552db.verified.txt index 5990183d03..428db6e268 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9cce7dd1a7552db.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9cce7dd1a7552db.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9f795c1a4a3dc7e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9f795c1a4a3dc7e.verified.txt index 16044da0f6..6e92936790 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9f795c1a4a3dc7e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_a9f795c1a4a3dc7e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aa5d6b47e3077133.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aa5d6b47e3077133.verified.txt index bef32db451..542dedfef9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aa5d6b47e3077133.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aa5d6b47e3077133.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aa6d2a79b976e71d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aa6d2a79b976e71d.verified.txt index 8bc97e2e80..b2540bd56c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aa6d2a79b976e71d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aa6d2a79b976e71d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab37f66cfadaa3e7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab37f66cfadaa3e7.verified.txt index a3e9f37f85..8c12bbcb60 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab37f66cfadaa3e7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab37f66cfadaa3e7.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab557800adb816a0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab557800adb816a0.verified.txt index c1a3608eaf..ca8c5c2d6e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab557800adb816a0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab557800adb816a0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab6c3870d7b072f5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab6c3870d7b072f5.verified.txt index aa2e8d1f49..7ed46a2c90 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab6c3870d7b072f5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab6c3870d7b072f5.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab6d6dac4001b394.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab6d6dac4001b394.verified.txt index b02a138237..e1e04cfb2b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab6d6dac4001b394.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ab6d6dac4001b394.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aba5fb5b005587ce.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aba5fb5b005587ce.verified.txt index 33dd1c6470..454470570e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aba5fb5b005587ce.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aba5fb5b005587ce.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_abbb1a9c3ca6dda8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_abbb1a9c3ca6dda8.verified.txt index b24eab9885..a1bd9bc63f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_abbb1a9c3ca6dda8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_abbb1a9c3ca6dda8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_accf8049754215f3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_accf8049754215f3.verified.txt index f9e9e4ce5b..a321112fd2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_accf8049754215f3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_accf8049754215f3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_acd834b5bd46cb01.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_acd834b5bd46cb01.verified.txt index 1bd2eb6a92..2f6d172245 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_acd834b5bd46cb01.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_acd834b5bd46cb01.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ad103b557df72a81.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ad103b557df72a81.verified.txt index 309866d1c7..d9ae17b6ba 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ad103b557df72a81.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ad103b557df72a81.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ad65b0052e93e330.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ad65b0052e93e330.verified.txt index e71c92a412..30be1ae1b0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ad65b0052e93e330.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ad65b0052e93e330.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_adc13c624670af54.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_adc13c624670af54.verified.txt index a131df41f7..842e8d97f4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_adc13c624670af54.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_adc13c624670af54.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae59e98f0cc98878.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae59e98f0cc98878.verified.txt index 5e5ccbda59..92bd338691 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae59e98f0cc98878.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae59e98f0cc98878.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae6a32601cd5623d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae6a32601cd5623d.verified.txt index eaa350bd76..c5df8a027b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae6a32601cd5623d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae6a32601cd5623d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae6c52842acb98e2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae6c52842acb98e2.verified.txt index 750702b160..6736665293 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae6c52842acb98e2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ae6c52842acb98e2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aed6013c5d56c9a0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aed6013c5d56c9a0.verified.txt index 3b02f9ddae..2b6cc0781b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aed6013c5d56c9a0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aed6013c5d56c9a0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_afa80fc141aac249.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_afa80fc141aac249.verified.txt index 1d73787e77..6240d03045 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_afa80fc141aac249.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_afa80fc141aac249.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_afa94c0f5d9ed8f8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_afa94c0f5d9ed8f8.verified.txt index c8f55b6c9c..fc95621774 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_afa94c0f5d9ed8f8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_afa94c0f5d9ed8f8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aff23a0ab1087672.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aff23a0ab1087672.verified.txt index ac87e8c3d6..84563981b5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aff23a0ab1087672.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_aff23a0ab1087672.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b03269d3742c3684.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b03269d3742c3684.verified.txt index 3ac0ba429b..6a38bb0ffb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b03269d3742c3684.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b03269d3742c3684.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0437731d6257775.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0437731d6257775.verified.txt index 62f14393c8..03096e7d60 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0437731d6257775.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0437731d6257775.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b08b505cae33e323.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b08b505cae33e323.verified.txt index 53d66ca0d4..d8c3051a77 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b08b505cae33e323.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b08b505cae33e323.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b08e0a8ba15a34f9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b08e0a8ba15a34f9.verified.txt index 5973496440..4483151d65 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b08e0a8ba15a34f9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b08e0a8ba15a34f9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0953a2773dad710.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0953a2773dad710.verified.txt index b6d213f65d..2ddc293481 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0953a2773dad710.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0953a2773dad710.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0bc842726317993.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0bc842726317993.verified.txt index a138b06946..4304de43b7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0bc842726317993.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b0bc842726317993.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b102417ccf7cd3ca.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b102417ccf7cd3ca.verified.txt index a4529ec94b..7324ad3b7d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b102417ccf7cd3ca.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b102417ccf7cd3ca.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b10b6a612bc75868.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b10b6a612bc75868.verified.txt index b1a529afdc..202a77b7ef 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b10b6a612bc75868.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b10b6a612bc75868.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b11157f641c8cd81.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b11157f641c8cd81.verified.txt index 5ba810523b..311ee70606 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b11157f641c8cd81.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b11157f641c8cd81.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b17627ec5b2594b4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b17627ec5b2594b4.verified.txt index 732fe6fab6..d6c865c89b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b17627ec5b2594b4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b17627ec5b2594b4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b18da007bdc0ae92.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b18da007bdc0ae92.verified.txt index f6bd4ab7df..606dd3cce3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b18da007bdc0ae92.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b18da007bdc0ae92.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1983b1b7873e212.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1983b1b7873e212.verified.txt index 82d7df68c9..ffdf38dd58 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1983b1b7873e212.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1983b1b7873e212.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1bd7bea4d32bfa0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1bd7bea4d32bfa0.verified.txt index c7e1f5098e..6e591d8ce8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1bd7bea4d32bfa0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1bd7bea4d32bfa0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1d8d300b99f8cdb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1d8d300b99f8cdb.verified.txt index 22db2b5d7c..814c2f971c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1d8d300b99f8cdb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b1d8d300b99f8cdb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b227222be18819fd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b227222be18819fd.verified.txt index 7942b97063..0c5fcf194e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b227222be18819fd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b227222be18819fd.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b271ce3dac5c3deb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b271ce3dac5c3deb.verified.txt index 08a506d929..3588e2c57c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b271ce3dac5c3deb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b271ce3dac5c3deb.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b298d0292072722a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b298d0292072722a.verified.txt index bb640f509a..ef4a5cf45b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b298d0292072722a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b298d0292072722a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b2b9db35e12a78e5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b2b9db35e12a78e5.verified.txt index 2674594859..cdee347fd2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b2b9db35e12a78e5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b2b9db35e12a78e5.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b2eca82355c60ed5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b2eca82355c60ed5.verified.txt index 3fd04a1cdc..fe2a464d9a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b2eca82355c60ed5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b2eca82355c60ed5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b31a24b3f97f3c03.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b31a24b3f97f3c03.verified.txt index f279bd3292..12ce26eb93 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b31a24b3f97f3c03.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b31a24b3f97f3c03.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3339b84ff0fa2a5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3339b84ff0fa2a5.verified.txt index dbaffde50c..bd8212d95a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3339b84ff0fa2a5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3339b84ff0fa2a5.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b33796c3e192797d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b33796c3e192797d.verified.txt index ef0a7e31c4..e821ce2875 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b33796c3e192797d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b33796c3e192797d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3a682de0c41d5e9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3a682de0c41d5e9.verified.txt index 8e86a9d22c..faaee1c7cb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3a682de0c41d5e9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3a682de0c41d5e9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3cc198c0e6f40e2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3cc198c0e6f40e2.verified.txt index b4249b9cc8..e28143bc50 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3cc198c0e6f40e2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b3cc198c0e6f40e2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b40ebee9a376a06f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b40ebee9a376a06f.verified.txt index 4a94e13a49..bc2b80704b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b40ebee9a376a06f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b40ebee9a376a06f.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b4e74cdeef5dcc46.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b4e74cdeef5dcc46.verified.txt index 7ca98a1ef4..948217b1c5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b4e74cdeef5dcc46.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b4e74cdeef5dcc46.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b5d7f04a9c4666df.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b5d7f04a9c4666df.verified.txt index 99e87ad1ff..d5a8102f15 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b5d7f04a9c4666df.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b5d7f04a9c4666df.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b5ef80563d878db0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b5ef80563d878db0.verified.txt index 1140924862..c437c846ae 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b5ef80563d878db0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b5ef80563d878db0.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6340dba18f32d03.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6340dba18f32d03.verified.txt index 0395fbef58..c2b14a76af 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6340dba18f32d03.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6340dba18f32d03.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b669a14f6b612d77.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b669a14f6b612d77.verified.txt index e844aafd91..c0800468f0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b669a14f6b612d77.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b669a14f6b612d77.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6ab96abbec2894e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6ab96abbec2894e.verified.txt index 0ab8d27fac..49d46b4efb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6ab96abbec2894e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6ab96abbec2894e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6bcfcc767bf8aa8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6bcfcc767bf8aa8.verified.txt index 2f0e8f479f..5f54b01d69 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6bcfcc767bf8aa8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6bcfcc767bf8aa8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6ef6b672f0fd098.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6ef6b672f0fd098.verified.txt index 253c2b677f..631e0525f7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6ef6b672f0fd098.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b6ef6b672f0fd098.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b77c5ff0006e8f97.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b77c5ff0006e8f97.verified.txt index b02bd9d4fa..4fd95c256a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b77c5ff0006e8f97.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b77c5ff0006e8f97.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b7ac0bb3daa0fe51.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b7ac0bb3daa0fe51.verified.txt index e20f355041..b57ecf8198 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b7ac0bb3daa0fe51.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b7ac0bb3daa0fe51.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b8bebaeda49a0b9d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b8bebaeda49a0b9d.verified.txt index fd039173cc..92d9476fbe 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b8bebaeda49a0b9d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b8bebaeda49a0b9d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b8e44296d5035084.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b8e44296d5035084.verified.txt index 0e549fa171..d4aabbfbc8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b8e44296d5035084.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b8e44296d5035084.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b92b2819d6600f42.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b92b2819d6600f42.verified.txt index 4f11227f7b..989b6cda6e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b92b2819d6600f42.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b92b2819d6600f42.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9302ddc3c71a56c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9302ddc3c71a56c.verified.txt index 983673044b..b171124af1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9302ddc3c71a56c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9302ddc3c71a56c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b93d7e67828d46d0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b93d7e67828d46d0.verified.txt index e93fb0f82a..c0ccb9de09 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b93d7e67828d46d0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b93d7e67828d46d0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b96e69acc89f6b8c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b96e69acc89f6b8c.verified.txt index a21324fd2b..428f8236ea 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b96e69acc89f6b8c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b96e69acc89f6b8c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b989fabae157647b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b989fabae157647b.verified.txt index e58bfeef96..2b3fc03cb1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b989fabae157647b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b989fabae157647b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99c01fc4cc25050.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99c01fc4cc25050.verified.txt index 7b4e754b50..e717acefb7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99c01fc4cc25050.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99c01fc4cc25050.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99fd451aa935623.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99fd451aa935623.verified.txt index 2a0a8c8eb7..94a0379335 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99fd451aa935623.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99fd451aa935623.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99fe093c03dcc56.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99fe093c03dcc56.verified.txt index 9bdbbca938..5ecd0f83c2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99fe093c03dcc56.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b99fe093c03dcc56.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9cbca8c3d93931d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9cbca8c3d93931d.verified.txt index 912ef14a24..329e9fb9b1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9cbca8c3d93931d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9cbca8c3d93931d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9fe67bd137c8480.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9fe67bd137c8480.verified.txt index 923516b3d2..5f40e0019a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9fe67bd137c8480.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_b9fe67bd137c8480.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ba4e189b80e92f49.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ba4e189b80e92f49.verified.txt index 9c6255af7b..226ddee3aa 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ba4e189b80e92f49.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ba4e189b80e92f49.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ba5f0c9f4a062315.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ba5f0c9f4a062315.verified.txt index f991aa70ec..abe747440f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ba5f0c9f4a062315.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ba5f0c9f4a062315.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bacbc0ddaffd2c7c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bacbc0ddaffd2c7c.verified.txt index 3c3d132155..15d4cb219c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bacbc0ddaffd2c7c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bacbc0ddaffd2c7c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb059858b3a4dd62.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb059858b3a4dd62.verified.txt index 2a894d11dd..f71ffb98ae 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb059858b3a4dd62.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb059858b3a4dd62.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb317c7fca3ef64d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb317c7fca3ef64d.verified.txt index 3425419011..c2400c25a6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb317c7fca3ef64d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb317c7fca3ef64d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb422f11df967bb1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb422f11df967bb1.verified.txt index 13d9baff72..1f6dbf0013 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb422f11df967bb1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bb422f11df967bb1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bbe2828aa2860386.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bbe2828aa2860386.verified.txt index 2589dcc4d9..4334227883 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bbe2828aa2860386.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bbe2828aa2860386.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bcdf6037107e346c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bcdf6037107e346c.verified.txt index 4c9375946e..6e1df4ad0c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bcdf6037107e346c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bcdf6037107e346c.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bcec9e643465de10.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bcec9e643465de10.verified.txt index 43f451bb60..2d74b0f787 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bcec9e643465de10.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bcec9e643465de10.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd113df7fb12fbbf.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd113df7fb12fbbf.verified.txt index 9432b46576..b4d14b0f05 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd113df7fb12fbbf.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd113df7fb12fbbf.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd22691af6b80ce1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd22691af6b80ce1.verified.txt index d3cc15e2fa..5afb237df1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd22691af6b80ce1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd22691af6b80ce1.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd322b92a9f41865.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd322b92a9f41865.verified.txt index a439e7773c..c09aeda142 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd322b92a9f41865.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd322b92a9f41865.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd43f6d21bfce307.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd43f6d21bfce307.verified.txt index d5182ac969..7d809fb62f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd43f6d21bfce307.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bd43f6d21bfce307.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bda82dcc9f2af714.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bda82dcc9f2af714.verified.txt index dcd598bed7..124c2e9367 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bda82dcc9f2af714.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bda82dcc9f2af714.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be36f5676d91428e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be36f5676d91428e.verified.txt index 87bc2db886..6c3b654139 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be36f5676d91428e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be36f5676d91428e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be413772c825426a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be413772c825426a.verified.txt index bf765ca593..0394661687 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be413772c825426a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be413772c825426a.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be66c192b4112576.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be66c192b4112576.verified.txt index bf041fc4e1..6b864c39a4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be66c192b4112576.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be66c192b4112576.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be84d2974cc58cd0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be84d2974cc58cd0.verified.txt index 876d320cce..bb3885c511 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be84d2974cc58cd0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be84d2974cc58cd0.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be9847c63eafbac8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be9847c63eafbac8.verified.txt index eb7a1bcc8b..dcfda1c951 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be9847c63eafbac8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_be9847c63eafbac8.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bea14fe938cd2ea5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bea14fe938cd2ea5.verified.txt index c2c64aa695..31a2746f54 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bea14fe938cd2ea5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bea14fe938cd2ea5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bedf407f53289876.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bedf407f53289876.verified.txt index 391657e63f..6259f7fe9a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bedf407f53289876.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bedf407f53289876.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf299a696eead5d4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf299a696eead5d4.verified.txt index 2bd11c0f7a..411804284b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf299a696eead5d4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf299a696eead5d4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf604717274c31f2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf604717274c31f2.verified.txt index 0bf2779f52..09c06f2663 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf604717274c31f2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf604717274c31f2.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf904685b1635430.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf904685b1635430.verified.txt index cf9be6f25b..c4223582eb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf904685b1635430.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bf904685b1635430.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bfa8c08e086d1079.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bfa8c08e086d1079.verified.txt index a61010926a..304fc4aaf2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bfa8c08e086d1079.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bfa8c08e086d1079.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bfc19447aaa8fa36.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bfc19447aaa8fa36.verified.txt index f946a89ee6..e0ff329e6a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bfc19447aaa8fa36.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_bfc19447aaa8fa36.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c00d48ce7c74dbfa.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c00d48ce7c74dbfa.verified.txt index 2ac957ff85..aa67215991 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c00d48ce7c74dbfa.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c00d48ce7c74dbfa.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c05e9dcf2f3c52b2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c05e9dcf2f3c52b2.verified.txt index 2514a52522..92a0da1e25 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c05e9dcf2f3c52b2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c05e9dcf2f3c52b2.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06a091774709463.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06a091774709463.verified.txt index faa2451c3d..2e546ae704 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06a091774709463.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06a091774709463.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06a3317515dd82f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06a3317515dd82f.verified.txt index 8ad809581f..760fd4b02e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06a3317515dd82f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06a3317515dd82f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06c38d61292585c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06c38d61292585c.verified.txt index 2fe509b631..48167fbe1e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06c38d61292585c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c06c38d61292585c.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0727a9dd03483c0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0727a9dd03483c0.verified.txt index 395eb3a144..c11b5c09d7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0727a9dd03483c0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0727a9dd03483c0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0787b8410370563.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0787b8410370563.verified.txt index 24dc3268bc..7c435863d6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0787b8410370563.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0787b8410370563.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0e27670f6aaf784.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0e27670f6aaf784.verified.txt index 51ed7ecf72..599fbf2bff 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0e27670f6aaf784.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c0e27670f6aaf784.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c10dac9ba8e7346a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c10dac9ba8e7346a.verified.txt index 282e524ec5..6fe0be9ecc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c10dac9ba8e7346a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c10dac9ba8e7346a.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c11cd2165f60bbaf.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c11cd2165f60bbaf.verified.txt index 23e831527e..1c4cf92c12 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c11cd2165f60bbaf.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c11cd2165f60bbaf.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c1c9d3ac4859ee8e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c1c9d3ac4859ee8e.verified.txt index 2d3bbffe0a..d0b5600729 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c1c9d3ac4859ee8e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c1c9d3ac4859ee8e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c1ef5e08f49adde8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c1ef5e08f49adde8.verified.txt index 7b698c1e17..abed2b5378 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c1ef5e08f49adde8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c1ef5e08f49adde8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c277f0a19b7b5653.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c277f0a19b7b5653.verified.txt index e6078c64c2..6676bb449b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c277f0a19b7b5653.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c277f0a19b7b5653.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c288932f9ffc3e6c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c288932f9ffc3e6c.verified.txt index fb04dd576e..eb2c4e9f89 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c288932f9ffc3e6c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c288932f9ffc3e6c.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c29ddc1f6001050b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c29ddc1f6001050b.verified.txt index cdf1773a37..1770aa9276 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c29ddc1f6001050b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c29ddc1f6001050b.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c2b5fe975d4c1e4d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c2b5fe975d4c1e4d.verified.txt index 7206992d5c..8729a1d00f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c2b5fe975d4c1e4d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c2b5fe975d4c1e4d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c3dc723beef1fce7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c3dc723beef1fce7.verified.txt index aeb7524bf4..7ec8c023c9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c3dc723beef1fce7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c3dc723beef1fce7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4232bde52281574.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4232bde52281574.verified.txt index 327b4d0080..eeeec655c7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4232bde52281574.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4232bde52281574.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c453cd131112230f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c453cd131112230f.verified.txt index 394cbb7eed..bd18e40ce6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c453cd131112230f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c453cd131112230f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c46a6db053398641.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c46a6db053398641.verified.txt index 03864fec30..3f9354b8b8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c46a6db053398641.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c46a6db053398641.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4a522bebc04b8c4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4a522bebc04b8c4.verified.txt index 3a5fcf334d..2c204a3182 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4a522bebc04b8c4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4a522bebc04b8c4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4b7946411c5e27c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4b7946411c5e27c.verified.txt index 2db82aa27e..b49ef95dcf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4b7946411c5e27c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4b7946411c5e27c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4c90437940e756d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4c90437940e756d.verified.txt index a84850445d..1985367073 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4c90437940e756d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4c90437940e756d.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4f3f4ae3c59c2e3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4f3f4ae3c59c2e3.verified.txt index e09829634c..07929be5b6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4f3f4ae3c59c2e3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4f3f4ae3c59c2e3.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4fe9eb36be08aa1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4fe9eb36be08aa1.verified.txt index c1199ec640..1b439d55ec 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4fe9eb36be08aa1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c4fe9eb36be08aa1.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c50fe9b0ce9d8735.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c50fe9b0ce9d8735.verified.txt index 7f79bc5cba..a6ebe56d37 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c50fe9b0ce9d8735.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c50fe9b0ce9d8735.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c512bae79c0fbcc7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c512bae79c0fbcc7.verified.txt index 8158025d07..dec61340b3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c512bae79c0fbcc7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c512bae79c0fbcc7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c528e3f2e01a5759.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c528e3f2e01a5759.verified.txt index b6d8c07216..4041a35006 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c528e3f2e01a5759.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c528e3f2e01a5759.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5b6fe8ad21b79f2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5b6fe8ad21b79f2.verified.txt index ad89d41f42..f7c159282f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5b6fe8ad21b79f2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5b6fe8ad21b79f2.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5bd9dcdf03b2dc2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5bd9dcdf03b2dc2.verified.txt index 94c3ae6ce0..04fd426ef9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5bd9dcdf03b2dc2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5bd9dcdf03b2dc2.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5dba07fa2fa4277.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5dba07fa2fa4277.verified.txt index 1d9d106eb6..2d08b15445 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5dba07fa2fa4277.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5dba07fa2fa4277.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5e837d745d45067.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5e837d745d45067.verified.txt index 4e7a806f12..bf963d44e8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5e837d745d45067.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c5e837d745d45067.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c6bb85518edce940.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c6bb85518edce940.verified.txt index e4fc07ffe8..6b22e8d3ae 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c6bb85518edce940.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c6bb85518edce940.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c71202fc43157eca.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c71202fc43157eca.verified.txt index b24859e9d3..1df89a5116 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c71202fc43157eca.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c71202fc43157eca.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c729e69e40b974d4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c729e69e40b974d4.verified.txt index 187b0b99f7..49f117e53b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c729e69e40b974d4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c729e69e40b974d4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c73a726a6e16643f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c73a726a6e16643f.verified.txt index 648c70e54e..9d39edf118 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c73a726a6e16643f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c73a726a6e16643f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c7471f617ca8fd47.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c7471f617ca8fd47.verified.txt index b7b798396b..60f7988164 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c7471f617ca8fd47.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c7471f617ca8fd47.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c75435bf65655137.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c75435bf65655137.verified.txt index a6fba79829..cffe5ada84 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c75435bf65655137.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c75435bf65655137.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c7dbd32ca29fab23.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c7dbd32ca29fab23.verified.txt index 4751b03df7..05865bd766 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c7dbd32ca29fab23.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c7dbd32ca29fab23.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8154863dce70d9c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8154863dce70d9c.verified.txt index 51270efdf7..67f633f650 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8154863dce70d9c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8154863dce70d9c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c82dcabd58f1b178.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c82dcabd58f1b178.verified.txt index 54b26d3a6b..6a3e4bb19d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c82dcabd58f1b178.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c82dcabd58f1b178.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c84077e206d1f99b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c84077e206d1f99b.verified.txt index c260a5389c..1bd4447d09 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c84077e206d1f99b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c84077e206d1f99b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c841a8bf41b79d61.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c841a8bf41b79d61.verified.txt index 4bb3ffe9ab..e818a36bc1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c841a8bf41b79d61.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c841a8bf41b79d61.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c86bc06ac3e471f3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c86bc06ac3e471f3.verified.txt index 03e4c9384b..37b5478865 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c86bc06ac3e471f3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c86bc06ac3e471f3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8d3f13f09c4cba2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8d3f13f09c4cba2.verified.txt index 6d271feb3d..49b7878a68 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8d3f13f09c4cba2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8d3f13f09c4cba2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8ec49e619492f16.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8ec49e619492f16.verified.txt index 90c7a2244c..f8b22923c7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8ec49e619492f16.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8ec49e619492f16.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8edc11e7b3a0937.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8edc11e7b3a0937.verified.txt index e6b8988de4..11cbbb8a93 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8edc11e7b3a0937.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c8edc11e7b3a0937.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c91fed278cff06b7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c91fed278cff06b7.verified.txt index 8f812ea403..50509cffdf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c91fed278cff06b7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c91fed278cff06b7.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9225241b59d840e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9225241b59d840e.verified.txt index d87d68a566..3b0ddac17d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9225241b59d840e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9225241b59d840e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c954cd8a0d77017d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c954cd8a0d77017d.verified.txt index 7f626b619d..5a7865f3a6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c954cd8a0d77017d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c954cd8a0d77017d.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c987aa4c35829f13.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c987aa4c35829f13.verified.txt index 8f2585466c..f328cc1b0b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c987aa4c35829f13.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c987aa4c35829f13.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9917fb063d2ccf1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9917fb063d2ccf1.verified.txt index 6089e85ace..0485c7df24 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9917fb063d2ccf1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9917fb063d2ccf1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9946dff3951db97.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9946dff3951db97.verified.txt index 49bf939742..af4e0079db 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9946dff3951db97.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9946dff3951db97.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9954182de948eca.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9954182de948eca.verified.txt index fa00e96ea6..82aa4ed6f4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9954182de948eca.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9954182de948eca.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c99cb0de17c1cfa5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c99cb0de17c1cfa5.verified.txt index 15e5ed9d98..23de31b8e9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c99cb0de17c1cfa5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c99cb0de17c1cfa5.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9a4b628a007cf9c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9a4b628a007cf9c.verified.txt index d62bab798c..63271a8e66 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9a4b628a007cf9c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9a4b628a007cf9c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9b1906d396e911c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9b1906d396e911c.verified.txt index d0b768ad12..d6c58b4434 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9b1906d396e911c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9b1906d396e911c.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9c1357248b5681f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9c1357248b5681f.verified.txt index b7dd3158c5..70924cc9d6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9c1357248b5681f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9c1357248b5681f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9c47221a0a929b1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9c47221a0a929b1.verified.txt index 01d1b972a2..d5f04022ec 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9c47221a0a929b1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9c47221a0a929b1.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9d2bb455edc7f63.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9d2bb455edc7f63.verified.txt index f446606e32..12c3fab4a8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9d2bb455edc7f63.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_c9d2bb455edc7f63.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca0ee81f642af861.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca0ee81f642af861.verified.txt index 0e33703535..2036460303 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca0ee81f642af861.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca0ee81f642af861.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca1e82fccc708e60.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca1e82fccc708e60.verified.txt index a73e0637d6..3dc60912d3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca1e82fccc708e60.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca1e82fccc708e60.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca2cf956d0628a4e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca2cf956d0628a4e.verified.txt index a81a3d5989..00096f88f6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca2cf956d0628a4e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca2cf956d0628a4e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca4a058c10d84f7a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca4a058c10d84f7a.verified.txt index 7268b5796f..2f85db0815 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca4a058c10d84f7a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca4a058c10d84f7a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca4ee236342bfea5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca4ee236342bfea5.verified.txt index 4dcc9fd3fb..35bff91919 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca4ee236342bfea5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca4ee236342bfea5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca77d52a3f4c58cf.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca77d52a3f4c58cf.verified.txt index d929cc4335..4453fe71e9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca77d52a3f4c58cf.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca77d52a3f4c58cf.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca7b5ac10d54b826.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca7b5ac10d54b826.verified.txt index 1b4c4d0888..be6236b207 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca7b5ac10d54b826.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ca7b5ac10d54b826.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cacf1ce1efd2b9ae.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cacf1ce1efd2b9ae.verified.txt index 42cfa1d74e..2a09df6e52 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cacf1ce1efd2b9ae.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cacf1ce1efd2b9ae.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb1c98c311689647.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb1c98c311689647.verified.txt index a905c6c313..0750007666 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb1c98c311689647.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb1c98c311689647.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb391c721779c6ce.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb391c721779c6ce.verified.txt index 189deea038..c6556d0d70 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb391c721779c6ce.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb391c721779c6ce.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb424edfb24483ee.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb424edfb24483ee.verified.txt index ac28a7c082..466536f654 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb424edfb24483ee.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cb424edfb24483ee.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cbd46a6612dba294.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cbd46a6612dba294.verified.txt index 7e6e909d96..af62b36780 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cbd46a6612dba294.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cbd46a6612dba294.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cc34f458ffcb8a14.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cc34f458ffcb8a14.verified.txt index 4099f01841..7fe364bdae 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cc34f458ffcb8a14.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cc34f458ffcb8a14.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ccf48e805e039fd0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ccf48e805e039fd0.verified.txt index 0bafec06c8..2008caded9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ccf48e805e039fd0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ccf48e805e039fd0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd2c57a2a56ee290.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd2c57a2a56ee290.verified.txt index fdfb54672a..97bb120d8e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd2c57a2a56ee290.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd2c57a2a56ee290.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd6519e005201bbc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd6519e005201bbc.verified.txt index af2088321f..b13637e7ef 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd6519e005201bbc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd6519e005201bbc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd96bd32f1659839.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd96bd32f1659839.verified.txt index ece94e87eb..6d90495b73 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd96bd32f1659839.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cd96bd32f1659839.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce13a09934485df1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce13a09934485df1.verified.txt index 4faf1fb3a1..fe5b41170b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce13a09934485df1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce13a09934485df1.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce617d3138e25438.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce617d3138e25438.verified.txt index 21510f1965..a7b887e4ac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce617d3138e25438.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce617d3138e25438.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce788e453ea2147e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce788e453ea2147e.verified.txt index 62c193cef8..5da28402d5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce788e453ea2147e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce788e453ea2147e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce939348f1017824.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce939348f1017824.verified.txt index 9778147033..011a27bc33 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce939348f1017824.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ce939348f1017824.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cef80047e475246e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cef80047e475246e.verified.txt index 3b85e7d2c7..3af0fb75ab 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cef80047e475246e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cef80047e475246e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf1fd0660620a6af.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf1fd0660620a6af.verified.txt index e1bdbbcfb3..2cc11228ce 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf1fd0660620a6af.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf1fd0660620a6af.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf54b9d469656cd2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf54b9d469656cd2.verified.txt index f188fa3446..cdbec37f67 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf54b9d469656cd2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf54b9d469656cd2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf8e6dbf384f7a98.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf8e6dbf384f7a98.verified.txt index b916418c19..9fd5aa986c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf8e6dbf384f7a98.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cf8e6dbf384f7a98.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cfa9c25e4e066413.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cfa9c25e4e066413.verified.txt index efdd51ffff..b106625fff 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cfa9c25e4e066413.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_cfa9c25e4e066413.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d0b0dc32687d30fa.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d0b0dc32687d30fa.verified.txt index 3dc3174dbc..7c2cc3c90e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d0b0dc32687d30fa.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d0b0dc32687d30fa.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d0cce4d493d71942.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d0cce4d493d71942.verified.txt index ec755f4474..e219b8dc9f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d0cce4d493d71942.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d0cce4d493d71942.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d121f938867a4aff.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d121f938867a4aff.verified.txt index 3752636d77..0b025b31a9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d121f938867a4aff.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d121f938867a4aff.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d1354de3e9fae8f4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d1354de3e9fae8f4.verified.txt index 98ee397995..ad6830baeb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d1354de3e9fae8f4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d1354de3e9fae8f4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d1b4474334c5117d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d1b4474334c5117d.verified.txt index da3036516d..cf46850da1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d1b4474334c5117d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d1b4474334c5117d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d216ef0460c3a7b4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d216ef0460c3a7b4.verified.txt index bf1d03bbd3..a24b69db31 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d216ef0460c3a7b4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d216ef0460c3a7b4.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d21dbb3a099da395.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d21dbb3a099da395.verified.txt index 651328133b..aaa5708f1a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d21dbb3a099da395.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d21dbb3a099da395.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d2472ba47fe70f93.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d2472ba47fe70f93.verified.txt index db8c99e6ae..ea46de3c41 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d2472ba47fe70f93.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d2472ba47fe70f93.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d2562fefd66b1f02.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d2562fefd66b1f02.verified.txt index ff52ea045e..c9af62945c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d2562fefd66b1f02.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d2562fefd66b1f02.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d35e91e202b9a7f3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d35e91e202b9a7f3.verified.txt index b6d578e6ca..f2036718c7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d35e91e202b9a7f3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d35e91e202b9a7f3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d38d4411139602de.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d38d4411139602de.verified.txt index 40d6acca7f..e92e9b0dde 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d38d4411139602de.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d38d4411139602de.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d3f9fcab39089b82.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d3f9fcab39089b82.verified.txt index 0977ed3344..01af60b9e5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d3f9fcab39089b82.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d3f9fcab39089b82.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d4627929e7d82733.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d4627929e7d82733.verified.txt index 673da528e9..fb1efe7007 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d4627929e7d82733.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d4627929e7d82733.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d47072e0a523c117.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d47072e0a523c117.verified.txt index 488b8d83c5..67df7ab711 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d47072e0a523c117.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d47072e0a523c117.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d486f72aa5acfe2f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d486f72aa5acfe2f.verified.txt index 4712889c6a..38f56a4f25 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d486f72aa5acfe2f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d486f72aa5acfe2f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d48a31a11778fec5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d48a31a11778fec5.verified.txt index 4563cfb47b..bc5df4f048 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d48a31a11778fec5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d48a31a11778fec5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d48bf6cf87134eac.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d48bf6cf87134eac.verified.txt index 9184d86185..2edac212bb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d48bf6cf87134eac.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d48bf6cf87134eac.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d49e85834d3ae9e1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d49e85834d3ae9e1.verified.txt index d8d09878da..da99270c39 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d49e85834d3ae9e1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d49e85834d3ae9e1.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d4be99e310c5484e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d4be99e310c5484e.verified.txt index 362ec38cf2..ffa6c03540 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d4be99e310c5484e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d4be99e310c5484e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d512997de79bdb40.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d512997de79bdb40.verified.txt index b82d5630f5..0badbe98ac 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d512997de79bdb40.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d512997de79bdb40.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d59853a76e29ffb5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d59853a76e29ffb5.verified.txt index 3e142a4d63..8d6f9ba13a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d59853a76e29ffb5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d59853a76e29ffb5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d5d8bc5e8c982f99.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d5d8bc5e8c982f99.verified.txt index 5cf462ea41..9fa8678d4b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d5d8bc5e8c982f99.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d5d8bc5e8c982f99.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d63cf40f531399a1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d63cf40f531399a1.verified.txt index f48eb8fef6..69889b87e2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d63cf40f531399a1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d63cf40f531399a1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d663737b6d1af602.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d663737b6d1af602.verified.txt index 68403aad0b..d5d7e513a0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d663737b6d1af602.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d663737b6d1af602.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d73b823f27173add.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d73b823f27173add.verified.txt index 52d095b47a..435007f01c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d73b823f27173add.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d73b823f27173add.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d77ba88ce2553d9b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d77ba88ce2553d9b.verified.txt index 100f1c0e4d..17a974b986 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d77ba88ce2553d9b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d77ba88ce2553d9b.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d794093c16027d04.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d794093c16027d04.verified.txt index 8883114e3d..71b0eeda21 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d794093c16027d04.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d794093c16027d04.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d7ffcf75a79ab366.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d7ffcf75a79ab366.verified.txt index 183afba21a..06d101c300 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d7ffcf75a79ab366.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d7ffcf75a79ab366.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d87ea6b71573f2ac.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d87ea6b71573f2ac.verified.txt index 68dff8c49e..9e53b530ad 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d87ea6b71573f2ac.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d87ea6b71573f2ac.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d883246e5727ab30.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d883246e5727ab30.verified.txt index be2002f861..02d914b4eb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d883246e5727ab30.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d883246e5727ab30.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d89db75876ceb58d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d89db75876ceb58d.verified.txt index 98be27a0a6..ebca3d5e1e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d89db75876ceb58d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d89db75876ceb58d.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d8ae2ca1009d50dd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d8ae2ca1009d50dd.verified.txt index ce9e6a7cfa..490b21a40f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d8ae2ca1009d50dd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d8ae2ca1009d50dd.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d91efac105621c68.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d91efac105621c68.verified.txt index 760d4cd0b1..023403cf9c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d91efac105621c68.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d91efac105621c68.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d932f99c8f13a13f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d932f99c8f13a13f.verified.txt index 169ee8b911..6e84903122 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d932f99c8f13a13f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d932f99c8f13a13f.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d96570e7fbd41cd3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d96570e7fbd41cd3.verified.txt index 9baf8c354e..27a4d38229 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d96570e7fbd41cd3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d96570e7fbd41cd3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d9aa484e68a7fccb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d9aa484e68a7fccb.verified.txt index e427b07125..dd1fc1a857 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d9aa484e68a7fccb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_d9aa484e68a7fccb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da22f3089f5b0814.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da22f3089f5b0814.verified.txt index dec5d4ea9b..39612bfe70 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da22f3089f5b0814.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da22f3089f5b0814.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da617283139df772.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da617283139df772.verified.txt index 2bd8a622a1..16e4b0a8e6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da617283139df772.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da617283139df772.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da6789b08b169f9d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da6789b08b169f9d.verified.txt index b43634eba1..da39df8b72 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da6789b08b169f9d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da6789b08b169f9d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da8897ebb8784e2d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da8897ebb8784e2d.verified.txt index b0aaf0a75f..486ddce7b3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da8897ebb8784e2d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da8897ebb8784e2d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da96115322311483.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da96115322311483.verified.txt index 7552522359..a23b714834 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da96115322311483.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da96115322311483.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da9b24b8e9bc0583.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da9b24b8e9bc0583.verified.txt index ee7d2ef082..771570d414 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da9b24b8e9bc0583.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_da9b24b8e9bc0583.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dafd02a6fbcefccc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dafd02a6fbcefccc.verified.txt index 9f8315a7de..152d9e34d6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dafd02a6fbcefccc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dafd02a6fbcefccc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_db00c53fe732922e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_db00c53fe732922e.verified.txt index 4bd4343e4a..e774682d38 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_db00c53fe732922e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_db00c53fe732922e.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_db4b0acf25630ea7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_db4b0acf25630ea7.verified.txt index acdfb98c6c..683907092b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_db4b0acf25630ea7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_db4b0acf25630ea7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbaa935a1190f66f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbaa935a1190f66f.verified.txt index 415804a598..04a83a54fc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbaa935a1190f66f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbaa935a1190f66f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbb104c413d6321f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbb104c413d6321f.verified.txt index 089efa6732..3120004d41 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbb104c413d6321f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbb104c413d6321f.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbe0f975e2bc684c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbe0f975e2bc684c.verified.txt index ee7acbf732..003eb77194 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbe0f975e2bc684c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbe0f975e2bc684c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbf64ac344cb4fe7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbf64ac344cb4fe7.verified.txt index 374bd62332..f9cb087656 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbf64ac344cb4fe7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dbf64ac344cb4fe7.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dc0886a61829b0fd.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dc0886a61829b0fd.verified.txt index f8b124c075..44bdf56d87 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dc0886a61829b0fd.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dc0886a61829b0fd.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dcc0b7ed2e5a6e29.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dcc0b7ed2e5a6e29.verified.txt index a9f338f176..581a4e6177 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dcc0b7ed2e5a6e29.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dcc0b7ed2e5a6e29.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dccaaac6244b115f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dccaaac6244b115f.verified.txt index ef2adce3b4..9774ca2201 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dccaaac6244b115f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dccaaac6244b115f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dd0ee5b0c8cd3a94.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dd0ee5b0c8cd3a94.verified.txt index 28bb20adf1..93ae22be1c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dd0ee5b0c8cd3a94.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dd0ee5b0c8cd3a94.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ddd86eda076cf4c0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ddd86eda076cf4c0.verified.txt index f168d36511..ae9fa2d0aa 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ddd86eda076cf4c0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ddd86eda076cf4c0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ddeff71a9b3cf261.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ddeff71a9b3cf261.verified.txt index 6021b6b120..507bb27067 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ddeff71a9b3cf261.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ddeff71a9b3cf261.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_de24f0aabba674d3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_de24f0aabba674d3.verified.txt index 15449cdf03..78a4e654e9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_de24f0aabba674d3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_de24f0aabba674d3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_de7b1899726e8402.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_de7b1899726e8402.verified.txt index 2dca18a3d2..aca04a3a92 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_de7b1899726e8402.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_de7b1899726e8402.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dec85c1ed5439c19.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dec85c1ed5439c19.verified.txt index 46c7878a57..d67ec0ba2e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dec85c1ed5439c19.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dec85c1ed5439c19.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_df82e6ddad53d5de.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_df82e6ddad53d5de.verified.txt index 7d31f20ffc..b463fc6004 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_df82e6ddad53d5de.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_df82e6ddad53d5de.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dfa31d30d8934ccb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dfa31d30d8934ccb.verified.txt index 0ad8fba393..9a03b1aaa4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dfa31d30d8934ccb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dfa31d30d8934ccb.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dfdeb98c15757187.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dfdeb98c15757187.verified.txt index 24cd210a6a..525f070dd6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dfdeb98c15757187.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_dfdeb98c15757187.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0045c5b324a8c38.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0045c5b324a8c38.verified.txt index 728f6d103c..b87053cada 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0045c5b324a8c38.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0045c5b324a8c38.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e01fe49115fcf6b0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e01fe49115fcf6b0.verified.txt index 01235fdf10..4332cfee4b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e01fe49115fcf6b0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e01fe49115fcf6b0.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e03eccfc917d77f8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e03eccfc917d77f8.verified.txt index a09eb05c44..e567b8b4eb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e03eccfc917d77f8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e03eccfc917d77f8.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e06ddd14adcd3568.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e06ddd14adcd3568.verified.txt index 417771116e..e4ea38de81 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e06ddd14adcd3568.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e06ddd14adcd3568.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0b1500cada1c6b4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0b1500cada1c6b4.verified.txt index bce0ff1608..3b88448648 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0b1500cada1c6b4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0b1500cada1c6b4.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0bfaae7c3781b2e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0bfaae7c3781b2e.verified.txt index f46b3d85b7..1dce5a8fdb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0bfaae7c3781b2e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e0bfaae7c3781b2e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e110eadf0cd68359.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e110eadf0cd68359.verified.txt index a635627dd0..21729ce557 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e110eadf0cd68359.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e110eadf0cd68359.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e11643ae26f075e8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e11643ae26f075e8.verified.txt index 9e55fcd9b5..56d6b7b456 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e11643ae26f075e8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e11643ae26f075e8.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNonebool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e12336a23be92453.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e12336a23be92453.verified.txt index 50501f0d69..bb28e3c212 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e12336a23be92453.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e12336a23be92453.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e126575458ee4aa1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e126575458ee4aa1.verified.txt index 4a7de29397..6736d9ef49 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e126575458ee4aa1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e126575458ee4aa1.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e13506a79bdcfcd2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e13506a79bdcfcd2.verified.txt index 7e274fa2c1..9cc475bde6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e13506a79bdcfcd2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e13506a79bdcfcd2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e16cfd70ba60d700.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e16cfd70ba60d700.verified.txt index 2cbae61891..19c2979dab 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e16cfd70ba60d700.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e16cfd70ba60d700.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e1e6dac3de0acebe.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e1e6dac3de0acebe.verified.txt index 08e2d30af1..19dbb6f46d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e1e6dac3de0acebe.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e1e6dac3de0acebe.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e21f2a2278bb2fc7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e21f2a2278bb2fc7.verified.txt index 86d3b2fac5..6e0ddeb44e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e21f2a2278bb2fc7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e21f2a2278bb2fc7.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e224d796c25ba863.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e224d796c25ba863.verified.txt index fccebb63c6..a16d9cb9c5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e224d796c25ba863.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e224d796c25ba863.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e249608ddaa5b9a2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e249608ddaa5b9a2.verified.txt index 774fd5a763..86990bf527 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e249608ddaa5b9a2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e249608ddaa5b9a2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e277854a2c4a06a1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e277854a2c4a06a1.verified.txt index dbe3aa71d8..b3255d325d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e277854a2c4a06a1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e277854a2c4a06a1.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e30d5add6ea73af6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e30d5add6ea73af6.verified.txt index 40a706ad9f..0af4dd6a15 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e30d5add6ea73af6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e30d5add6ea73af6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e34feb378629efb2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e34feb378629efb2.verified.txt index e7dba23942..2f3d384389 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e34feb378629efb2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e34feb378629efb2.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e387c177c339a656.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e387c177c339a656.verified.txt index 189049e690..6a76b79477 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e387c177c339a656.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e387c177c339a656.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e3cf4fcd9442043e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e3cf4fcd9442043e.verified.txt index 90e45e22b1..6e4b554209 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e3cf4fcd9442043e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e3cf4fcd9442043e.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e3cfa61ca18d8d38.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e3cfa61ca18d8d38.verified.txt index 1f4beba16e..10fc5bcd24 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e3cfa61ca18d8d38.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e3cfa61ca18d8d38.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNoneshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e40acbf5919b0649.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e40acbf5919b0649.verified.txt index 2de5c39a1d..8731d9de7c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e40acbf5919b0649.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e40acbf5919b0649.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4147acf90bd6ae1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4147acf90bd6ae1.verified.txt index 348797efa8..2d69bdcb74 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4147acf90bd6ae1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4147acf90bd6ae1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4157ded2142a665.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4157ded2142a665.verified.txt index b249424aaf..413afba273 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4157ded2142a665.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4157ded2142a665.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e419c934080154d3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e419c934080154d3.verified.txt index 9ce25b3df2..d8dace7c68 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e419c934080154d3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e419c934080154d3.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e43482890f0efed9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e43482890f0efed9.verified.txt index 5c27a8e302..f9d618c68a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e43482890f0efed9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e43482890f0efed9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4553d89cbb731f4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4553d89cbb731f4.verified.txt index 06b6b837c6..d26e10bf57 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4553d89cbb731f4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e4553d89cbb731f4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e467068e6ca0ff61.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e467068e6ca0ff61.verified.txt index ab20079f78..e82dddfdb4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e467068e6ca0ff61.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e467068e6ca0ff61.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e50da49a47dc87cc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e50da49a47dc87cc.verified.txt index 8de5d811b2..762c98a89a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e50da49a47dc87cc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e50da49a47dc87cc.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e53aaaec90a49199.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e53aaaec90a49199.verified.txt index 9fba0bda27..b89a77dc0a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e53aaaec90a49199.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e53aaaec90a49199.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e56f31bd449409bf.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e56f31bd449409bf.verified.txt index 6fc8425414..4e26548d59 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e56f31bd449409bf.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e56f31bd449409bf.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e57a80e69d260d46.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e57a80e69d260d46.verified.txt index 42a0e1334b..3f1e895639 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e57a80e69d260d46.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e57a80e69d260d46.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e57ece18706c5547.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e57ece18706c5547.verified.txt index 09f046ad27..6d6d7ce193 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e57ece18706c5547.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e57ece18706c5547.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e5f56ba207491782.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e5f56ba207491782.verified.txt index 1767bb5c13..e30924d9df 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e5f56ba207491782.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e5f56ba207491782.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6240b1fb5be6acf.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6240b1fb5be6acf.verified.txt index 5c11a03ec0..35ea777997 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6240b1fb5be6acf.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6240b1fb5be6acf.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e63eab4bf226b92f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e63eab4bf226b92f.verified.txt index b0756e4986..e00fc49606 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e63eab4bf226b92f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e63eab4bf226b92f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e64b094c6a5c5102.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e64b094c6a5c5102.verified.txt index 341204faf5..9711129ba5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e64b094c6a5c5102.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e64b094c6a5c5102.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e659a4068e7e31c9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e659a4068e7e31c9.verified.txt index a6c85973f2..e603ccfaec 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e659a4068e7e31c9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e659a4068e7e31c9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e664681d0d43d7f0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e664681d0d43d7f0.verified.txt index 50e7fece1d..13b85d7245 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e664681d0d43d7f0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e664681d0d43d7f0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6902083efb6da26.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6902083efb6da26.verified.txt index c339edd2a9..01c5f77334 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6902083efb6da26.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6902083efb6da26.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6bff376febb2d96.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6bff376febb2d96.verified.txt index 4498875f95..7a45b5c273 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6bff376febb2d96.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6bff376febb2d96.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6eadfbb315ade9f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6eadfbb315ade9f.verified.txt index 8093102e32..c74f1317e8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6eadfbb315ade9f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6eadfbb315ade9f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6f6c8b6235cd59b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6f6c8b6235cd59b.verified.txt index fcb6a1d9da..89457a0631 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6f6c8b6235cd59b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e6f6c8b6235cd59b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e70176e0489e356a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e70176e0489e356a.verified.txt index 90b5687962..3f9a5b0c62 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e70176e0489e356a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e70176e0489e356a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e771787defee4a4b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e771787defee4a4b.verified.txt index 52f103e638..e62b5d0ffe 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e771787defee4a4b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e771787defee4a4b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e793f2f212e89480.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e793f2f212e89480.verified.txt index d32ed2d568..38b2e700f4 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e793f2f212e89480.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e793f2f212e89480.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e7b775428eb9240f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e7b775428eb9240f.verified.txt index fd036ac12e..77eeeb1b38 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e7b775428eb9240f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e7b775428eb9240f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e7d03c097ffdf692.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e7d03c097ffdf692.verified.txt index f58f3da044..c456f497e2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e7d03c097ffdf692.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e7d03c097ffdf692.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8224c98b7673d46.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8224c98b7673d46.verified.txt index 3e64585a79..a0b2444f3b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8224c98b7673d46.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8224c98b7673d46.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e82368f327d3c64c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e82368f327d3c64c.verified.txt index b2d5add841..be116ba52e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e82368f327d3c64c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e82368f327d3c64c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e837757415cf9a87.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e837757415cf9a87.verified.txt index 49cd0323b8..1f6d0de668 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e837757415cf9a87.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e837757415cf9a87.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8ab41f6c2551162.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8ab41f6c2551162.verified.txt index a1db667a2b..c0da46f5b8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8ab41f6c2551162.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8ab41f6c2551162.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8fb38ce7a501fb4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8fb38ce7a501fb4.verified.txt index 1a6f3441a7..e14132a02d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8fb38ce7a501fb4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e8fb38ce7a501fb4.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e90739ee77f59479.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e90739ee77f59479.verified.txt index 6df8c60a56..ab42a19e00 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e90739ee77f59479.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e90739ee77f59479.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e915f7eb20aab958.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e915f7eb20aab958.verified.txt index 07ed8e95f5..d9a4fa607e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e915f7eb20aab958.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e915f7eb20aab958.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e93ac5ecdd8dd0ca.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e93ac5ecdd8dd0ca.verified.txt index b4473f551f..9968eedfbf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e93ac5ecdd8dd0ca.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e93ac5ecdd8dd0ca.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e960e1679f126480.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e960e1679f126480.verified.txt index b6db7b13fd..f242885f81 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e960e1679f126480.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e960e1679f126480.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordImplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9618be5f9ed361a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9618be5f9ed361a.verified.txt index a1d4021156..2ea72dbf74 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9618be5f9ed361a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9618be5f9ed361a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9e2add4c0418f13.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9e2add4c0418f13.verified.txt index 04f489790d..100f84416c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9e2add4c0418f13.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9e2add4c0418f13.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9e9ee18eeea2c6a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9e9ee18eeea2c6a.verified.txt index 9955d605cc..e0d781e28c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9e9ee18eeea2c6a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9e9ee18eeea2c6a.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9f123caf0dee076.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9f123caf0dee076.verified.txt index 5f8832029d..d5449de1ef 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9f123caf0dee076.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_e9f123caf0dee076.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea0b947d150a50df.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea0b947d150a50df.verified.txt index 0c8478bc92..c7adc75dce 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea0b947d150a50df.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea0b947d150a50df.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea3ea92fbacf24dc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea3ea92fbacf24dc.verified.txt index 1bd93f33ed..9092336622 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea3ea92fbacf24dc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea3ea92fbacf24dc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea5cf282ab8113f7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea5cf282ab8113f7.verified.txt index 6bb4f2fe80..d6e6d9587a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea5cf282ab8113f7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea5cf282ab8113f7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea6fe6dc9dcb8362.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea6fe6dc9dcb8362.verified.txt index e379ba1a19..eb05bf0a18 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea6fe6dc9dcb8362.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ea6fe6dc9dcb8362.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ead8d26ce2607cd3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ead8d26ce2607cd3.verified.txt index 4e46681150..972a63325b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ead8d26ce2607cd3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ead8d26ce2607cd3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eb442e78731d096a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eb442e78731d096a.verified.txt index 9d6c6fc435..7ac34c6469 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eb442e78731d096a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eb442e78731d096a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ebf71e6be56c90c6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ebf71e6be56c90c6.verified.txt index 1c76110777..457e4df238 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ebf71e6be56c90c6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ebf71e6be56c90c6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ebfc93a613cf6dff.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ebfc93a613cf6dff.verified.txt index 16b3443458..29c173d2d1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ebfc93a613cf6dff.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ebfc93a613cf6dff.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ec30ed4bf879e7c8.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ec30ed4bf879e7c8.verified.txt index 5a7b9a9dff..abed9b3126 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ec30ed4bf879e7c8.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ec30ed4bf879e7c8.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ec71225de502a222.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ec71225de502a222.verified.txt index 50bd00dd48..2d8d8ea2bf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ec71225de502a222.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ec71225de502a222.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ecbdaa5b67718b11.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ecbdaa5b67718b11.verified.txt index bad800e02c..65716fd8b6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ecbdaa5b67718b11.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ecbdaa5b67718b11.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ece7ac813f957972.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ece7ac813f957972.verified.txt index 6fd7364c43..c702a0a193 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ece7ac813f957972.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ece7ac813f957972.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed3822db65bdc7b2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed3822db65bdc7b2.verified.txt index 3b59cfd832..ce0f1b02ba 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed3822db65bdc7b2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed3822db65bdc7b2.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed42bf4f42cdccdb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed42bf4f42cdccdb.verified.txt index 1256dd7014..11ecc746b0 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed42bf4f42cdccdb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed42bf4f42cdccdb.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed8974d12fcd58d2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed8974d12fcd58d2.verified.txt index 42d88b0085..9ac268114a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed8974d12fcd58d2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ed8974d12fcd58d2.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee39b4936c6fe74e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee39b4936c6fe74e.verified.txt index bc7cd3a93a..c1d766204b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee39b4936c6fe74e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee39b4936c6fe74e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee519273ae3efa0c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee519273ae3efa0c.verified.txt index dc23b8b030..384a1b90d7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee519273ae3efa0c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee519273ae3efa0c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee5f295ceb50175d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee5f295ceb50175d.verified.txt index c9bca4cd39..a02c647fbc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee5f295ceb50175d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee5f295ceb50175d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee6d718ab7d85638.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee6d718ab7d85638.verified.txt index 7cfe905e88..53388e5586 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee6d718ab7d85638.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ee6d718ab7d85638.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eebcb11e9d0c1bec.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eebcb11e9d0c1bec.verified.txt index 6e9f83ebf5..fadf6ba4f6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eebcb11e9d0c1bec.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eebcb11e9d0c1bec.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef3bd3b0553a82a9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef3bd3b0553a82a9.verified.txt index 4642151e39..03e3dd9749 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef3bd3b0553a82a9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef3bd3b0553a82a9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef720282f80f163d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef720282f80f163d.verified.txt index 9daf4a1101..f61d6b55e3 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef720282f80f163d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef720282f80f163d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef7b1c443c4d2b2f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef7b1c443c4d2b2f.verified.txt index e2a0c8edb1..44c9a29086 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef7b1c443c4d2b2f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ef7b1c443c4d2b2f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_efacab428af8a540.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_efacab428af8a540.verified.txt index 932c5f1d08..8b6a6b261b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_efacab428af8a540.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_efacab428af8a540.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_efcf3f3288fd9f3a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_efcf3f3288fd9f3a.verified.txt index e3b1119bcc..3ac9c53354 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_efcf3f3288fd9f3a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_efcf3f3288fd9f3a.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eff79cb015e434ae.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eff79cb015e434ae.verified.txt index ddc9509864..fba3459ebc 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eff79cb015e434ae.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_eff79cb015e434ae.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classImplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0cb1bc4c1868d05.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0cb1bc4c1868d05.verified.txt index b0c3b47b71..42af84f9da 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0cb1bc4c1868d05.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0cb1bc4c1868d05.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0d0defc91082b1b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0d0defc91082b1b.verified.txt index 7ce95442a2..ad56a92d57 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0d0defc91082b1b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0d0defc91082b1b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0f20b4d0dee5d9e.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0f20b4d0dee5d9e.verified.txt index 7630e59440..f3a5c12a99 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0f20b4d0dee5d9e.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f0f20b4d0dee5d9e.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f11f7363f14d8dca.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f11f7363f14d8dca.verified.txt index 70dcd74fc8..96b394feb2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f11f7363f14d8dca.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f11f7363f14d8dca.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordNoneExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1344614e2193f8b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1344614e2193f8b.verified.txt index 4d1935ff23..111951a181 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1344614e2193f8b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1344614e2193f8b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f13c0604f043ba83.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f13c0604f043ba83.verified.txt index 8ce79fec64..b5daec1d74 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f13c0604f043ba83.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f13c0604f043ba83.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitNonedouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f16a660ddc43c15c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f16a660ddc43c15c.verified.txt index 0b2f85125c..2f10efefd6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f16a660ddc43c15c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f16a660ddc43c15c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1b0c0a8b6a1e7fc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1b0c0a8b6a1e7fc.verified.txt index c4ca90119a..d1f9982643 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1b0c0a8b6a1e7fc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1b0c0a8b6a1e7fc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1d44dd71d288957.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1d44dd71d288957.verified.txt index 98a426aa4f..36c097d7d9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1d44dd71d288957.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1d44dd71d288957.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1e0ff765a22a5a0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1e0ff765a22a5a0.verified.txt index bd4e0990bf..8267dc77ae 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1e0ff765a22a5a0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1e0ff765a22a5a0.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1f54648829805a7.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1f54648829805a7.verified.txt index 0a09270755..cb6c76f73a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1f54648829805a7.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f1f54648829805a7.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f22764bf85dd7067.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f22764bf85dd7067.verified.txt index c6d59d6b5e..1cae9738f7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f22764bf85dd7067.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f22764bf85dd7067.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f23391beb1a84fe3.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f23391beb1a84fe3.verified.txt index 511cdf70bd..210c773730 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f23391beb1a84fe3.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f23391beb1a84fe3.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f26346ed293c1fd0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f26346ed293c1fd0.verified.txt index be2b7a49a8..dfb59e0418 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f26346ed293c1fd0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f26346ed293c1fd0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2bcc50a6485ac87.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2bcc50a6485ac87.verified.txt index 80219f802f..542be911c1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2bcc50a6485ac87.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2bcc50a6485ac87.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2dba8f6d12006fb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2dba8f6d12006fb.verified.txt index be493f8460..ef13ca03cd 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2dba8f6d12006fb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2dba8f6d12006fb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordImplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2de388451b846cb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2de388451b846cb.verified.txt index e03367332e..9f89168062 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2de388451b846cb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f2de388451b846cb.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitImplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f301c12f0099fa83.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f301c12f0099fa83.verified.txt index 787e927dc6..98dc99c9e7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f301c12f0099fa83.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f301c12f0099fa83.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f35ca87e848fe958.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f35ca87e848fe958.verified.txt index 6b00cd3b4b..a7cc98293a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f35ca87e848fe958.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f35ca87e848fe958.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneImplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f36e259cea8673c5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f36e259cea8673c5.verified.txt index 09bef9a133..df9373fbd8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f36e259cea8673c5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f36e259cea8673c5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f38e9dab6ac824ed.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f38e9dab6ac824ed.verified.txt index 35510d5320..fe6694f02d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f38e9dab6ac824ed.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f38e9dab6ac824ed.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f396c3d0094f3511.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f396c3d0094f3511.verified.txt index e4e14bef9d..7ad10dcd84 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f396c3d0094f3511.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f396c3d0094f3511.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f397f2a2b36d12c5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f397f2a2b36d12c5.verified.txt index fcab953b76..7e50d6fd99 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f397f2a2b36d12c5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f397f2a2b36d12c5.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f3b4556818570ae6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f3b4556818570ae6.verified.txt index 66fe2cf9c8..06bb43122f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f3b4556818570ae6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f3b4556818570ae6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitImplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f41f68eb3459ae9d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f41f68eb3459ae9d.verified.txt index 4e64664a92..1762867256 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f41f68eb3459ae9d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f41f68eb3459ae9d.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitExplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f45565ee0aefb58f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f45565ee0aefb58f.verified.txt index b43124f6e5..caf0aba8c6 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f45565ee0aefb58f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f45565ee0aefb58f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f4d81be4e42d003b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f4d81be4e42d003b.verified.txt index f92ab66a8a..c243f5a26e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f4d81be4e42d003b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f4d81be4e42d003b.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5012163c88d6f7a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5012163c88d6f7a.verified.txt index ae08c44b63..9d06db24ed 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5012163c88d6f7a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5012163c88d6f7a.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5be229116372875.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5be229116372875.verified.txt index 0f03d36ede..24aab3fc83 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5be229116372875.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5be229116372875.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "boolean"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5cb71c3dcc47563.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5cb71c3dcc47563.verified.txt index 43820985d8..9a6ed9f86d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5cb71c3dcc47563.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f5cb71c3dcc47563.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f61b10fdcf0f518a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f61b10fdcf0f518a.verified.txt index 08f91c86d4..b8a1a3d28e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f61b10fdcf0f518a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f61b10fdcf0f518a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structImplicitImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f61c87fa9ac2da4b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f61c87fa9ac2da4b.verified.txt index 237bd67281..e0f0e242b8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f61c87fa9ac2da4b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f61c87fa9ac2da4b.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f620a7aa9bfb56b0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f620a7aa9bfb56b0.verified.txt index 9f16240ba3..24cbf01b9d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f620a7aa9bfb56b0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f620a7aa9bfb56b0.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structExplicitNone)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f67051ace0e3fbed.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f67051ace0e3fbed.verified.txt index 5ef046949d..65f07c47a2 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f67051ace0e3fbed.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f67051ace0e3fbed.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6859535ce1bf3a6.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6859535ce1bf3a6.verified.txt index 2d179eca17..0417c591c5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6859535ce1bf3a6.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6859535ce1bf3a6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitImplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f68c19de8a394152.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f68c19de8a394152.verified.txt index 7346db46c7..e67e131e9d 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f68c19de8a394152.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f68c19de8a394152.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structNoneNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6b60ade6a11fa6f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6b60ade6a11fa6f.verified.txt index 87b6692448..9151e03682 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6b60ade6a11fa6f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6b60ade6a11fa6f.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6c47f6472ded299.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6c47f6472ded299.verified.txt index dcf23d19bd..d3817fea7c 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6c47f6472ded299.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6c47f6472ded299.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_recordExplicitExplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6e158a4537ff6c4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6e158a4537ff6c4.verified.txt index ea675909c1..a29944593a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6e158a4537ff6c4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6e158a4537ff6c4.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6ec22721fee54fb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6ec22721fee54fb.verified.txt index 1579b3efef..6c5c400e8e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6ec22721fee54fb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6ec22721fee54fb.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6f5b66c115cfe4f.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6f5b66c115cfe4f.verified.txt index d9b5d1690f..b929fef3a8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6f5b66c115cfe4f.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f6f5b66c115cfe4f.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneExplicitbyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f73d1178640672c5.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f73d1178640672c5.verified.txt index a019ba5a88..ce9be43058 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f73d1178640672c5.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f73d1178640672c5.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structImplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f7d1815b7ccbd657.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f7d1815b7ccbd657.verified.txt index dc1244546a..53aeb6ff68 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f7d1815b7ccbd657.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f7d1815b7ccbd657.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f80e8de1fae6a65d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f80e8de1fae6a65d.verified.txt index 55083c26a9..a7baf778fb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f80e8de1fae6a65d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f80e8de1fae6a65d.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f8ac86eb8b8128e0.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f8ac86eb8b8128e0.verified.txt index 1af7c17ccb..d56fc8318b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f8ac86eb8b8128e0.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f8ac86eb8b8128e0.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordNoneNonestring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f8fb4df98fdc6b64.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f8fb4df98fdc6b64.verified.txt index 91ade79600..0b86148b77 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f8fb4df98fdc6b64.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f8fb4df98fdc6b64.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classExplicitImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f900b4d5e2f0e655.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f900b4d5e2f0e655.verified.txt index bfc950c065..87a73a0bcb 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f900b4d5e2f0e655.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f900b4d5e2f0e655.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitNonelong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f93c141db3998dac.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f93c141db3998dac.verified.txt index 4d96fb508d..69e8aad276 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f93c141db3998dac.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f93c141db3998dac.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNoneSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f9c7a1815b335404.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f9c7a1815b335404.verified.txt index bd7d8b4dee..ccf3c99d43 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f9c7a1815b335404.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_f9c7a1815b335404.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitNoneint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa336c022f1543c1.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa336c022f1543c1.verified.txt index e526fa6043..94137c427f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa336c022f1543c1.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa336c022f1543c1.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa4656d0f8876774.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa4656d0f8876774.verified.txt index 087482e42a..f737552c79 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa4656d0f8876774.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa4656d0f8876774.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classImplicitExplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa53b606e523ceff.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa53b606e523ceff.verified.txt index 5384950edd..bd987b8f56 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa53b606e523ceff.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fa53b606e523ceff.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int64"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitlong)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int64" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_faa1e6703da506fe.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_faa1e6703da506fe.verified.txt index 76aa767533..0234cf07f1 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_faa1e6703da506fe.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_faa1e6703da506fe.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitchar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_faf49716d0cf46ff.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_faf49716d0cf46ff.verified.txt index e6a726783a..25d1aa69c8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_faf49716d0cf46ff.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_faf49716d0cf46ff.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitdecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbb53840fa015194.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbb53840fa015194.verified.txt index 199a1583e8..aa41f7e63e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbb53840fa015194.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbb53840fa015194.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNonefloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbb5fdbf3a11b087.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbb5fdbf3a11b087.verified.txt index ea9fd2a502..739adcd04b 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbb5fdbf3a11b087.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbb5fdbf3a11b087.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicitbool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbdc6d16b8c535c4.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbdc6d16b8c535c4.verified.txt index fe3dfcf74d..e7c6cc2d63 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbdc6d16b8c535c4.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbdc6d16b8c535c4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_classNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_classNoneExplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbf26a4b7ceb8eba.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbf26a4b7ceb8eba.verified.txt index 9d80b7c82c..a4e96a5a51 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbf26a4b7ceb8eba.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fbf26a4b7ceb8eba.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc06b5017bfaf9f9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc06b5017bfaf9f9.verified.txt index 1a2fd66eac..cbe8a363e9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc06b5017bfaf9f9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc06b5017bfaf9f9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitSystem_DateTime)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc0dff4be7b8f19d.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc0dff4be7b8f19d.verified.txt index 18e17e837d..9c18c5ed5f 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc0dff4be7b8f19d.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc0dff4be7b8f19d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc4c0e372635b0dc.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc4c0e372635b0dc.verified.txt index 50ea2ecab1..dfbef830db 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc4c0e372635b0dc.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc4c0e372635b0dc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structNoneNoneSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc587ef5e7021a3a.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc587ef5e7021a3a.verified.txt index 484f58a9c4..639fa1fb7a 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc587ef5e7021a3a.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fc587ef5e7021a3a.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structExplicitNonebyte)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fcf161275df488ea.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fcf161275df488ea.verified.txt index 846e6c2c87..53e9190244 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fcf161275df488ea.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fcf161275df488ea.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_structNoneExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fd0b3567be8115ae.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fd0b3567be8115ae.verified.txt index a0d8d6e3b8..7ef10923d5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fd0b3567be8115ae.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fd0b3567be8115ae.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classNoneImplicitint)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fdcce74b1bf18b70.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fdcce74b1bf18b70.verified.txt index 5f46766d56..fbc17035b9 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fdcce74b1bf18b70.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fdcce74b1bf18b70.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitNonechar)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fde1254e77d89b21.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fde1254e77d89b21.verified.txt index 3f055f092b..02c23da6a5 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fde1254e77d89b21.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fde1254e77d89b21.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneImplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe0ec33aa9c76d20.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe0ec33aa9c76d20.verified.txt index 95a341e1ff..005a7ccad8 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe0ec33aa9c76d20.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe0ec33aa9c76d20.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitImplicitstring)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe306410050dd481.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe306410050dd481.verified.txt index 722b034a6f..9a19aa8f16 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe306410050dd481.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe306410050dd481.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitdouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe378db7b3dd5824.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe378db7b3dd5824.verified.txt index 59caff9f15..f89285aa28 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe378db7b3dd5824.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe378db7b3dd5824.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classExplicitExplicitfloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe40f87af1f241a2.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe40f87af1f241a2.verified.txt index e630b34a40..6813e96831 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe40f87af1f241a2.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fe40f87af1f241a2.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_recordExplicitImplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fea89883ed414cbb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fea89883ed414cbb.verified.txt index e3e47a1749..05fe9fa5e7 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fea89883ed414cbb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fea89883ed414cbb.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_structExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_structExplicitExplicitshort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_feaaced6d234c67c.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_feaaced6d234c67c.verified.txt index 11c978127f..883e97582e 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_feaaced6d234c67c.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_feaaced6d234c67c.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_structImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_structImplicitNonedecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fef7c5bb53311179.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fef7c5bb53311179.verified.txt index 889fe72cfc..6933174c87 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fef7c5bb53311179.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_fef7c5bb53311179.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structNoneNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ff05c6e0200c7b3b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ff05c6e0200c7b3b.verified.txt index 19cfb89396..93cb04df96 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ff05c6e0200c7b3b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ff05c6e0200c7b3b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_record_classExplicitExplicitSystem_Guid)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ff12c2487827736b.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ff12c2487827736b.verified.txt index f7797f4d8d..4d14995eaf 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ff12c2487827736b.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ff12c2487827736b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_partial_record_classExplicitImplicit)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ffc1d2d9ac4983a9.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ffc1d2d9ac4983a9.verified.txt index c8bd359fe9..2056396d74 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ffc1d2d9ac4983a9.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ffc1d2d9ac4983a9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_readonly_partial_record_structImplicitExplicitSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ffcf94ee020af0bb.verified.txt b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ffcf94ee020af0bb.verified.txt index e9ec2b9a77..4118bbaf69 100644 --- a/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ffcf94ee020af0bb.verified.txt +++ b/tests/SnapshotTests/Casting/snapshots/snap-v9.0/CastingGenerationTests.Can_specify_casting_at_the_global_config_level_ffcf94ee020af0bb.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever._casting_public_sealed_partial_classImplicitNoneSystem_DateTimeOffset)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Conversion_and_exceptions_override.verified.txt b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Conversion_and_exceptions_override.verified.txt index db3c5a2945..429b6eefb8 100644 --- a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Conversion_and_exceptions_override.verified.txt +++ b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Conversion_and_exceptions_override.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Customization_override.verified.txt b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Customization_override.verified.txt index 4d20603081..210ac33c0d 100644 --- a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Customization_override.verified.txt +++ b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Customization_override.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Disable_stack_trace_recording_in_debug.verified.txt b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Disable_stack_trace_recording_in_debug.verified.txt index 6f7a7cb1f5..2ff0548031 100644 --- a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Disable_stack_trace_recording_in_debug.verified.txt +++ b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Disable_stack_trace_recording_in_debug.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Enable_stack_trace_recoding_in_debug.verified.txt b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Enable_stack_trace_recoding_in_debug.verified.txt index f26f4f0cbd..4edd8f79b6 100644 --- a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Enable_stack_trace_recoding_in_debug.verified.txt +++ b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Enable_stack_trace_recoding_in_debug.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Exception_override.verified.txt b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Exception_override.verified.txt index 1fc510593c..5471bdd7b0 100644 --- a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Exception_override.verified.txt +++ b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Exception_override.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Exception_override_in_different_namespace.verified.txt b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Exception_override_in_different_namespace.verified.txt index be3295feec..3536cb41d1 100644 --- a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Exception_override_in_different_namespace.verified.txt +++ b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Exception_override_in_different_namespace.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.OmitDebugAttributes_override.verified.txt b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.OmitDebugAttributes_override.verified.txt index 80fd5ec927..aa3e75e5e9 100644 --- a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.OmitDebugAttributes_override.verified.txt +++ b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.OmitDebugAttributes_override.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "integer"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Override_all.verified.txt b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Override_all.verified.txt index 6a4bdc3c59..39c8281750 100644 --- a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Override_all.verified.txt +++ b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Override_all.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Type_override.verified.txt b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Type_override.verified.txt index 6a87c713e9..e590511393 100644 --- a/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Type_override.verified.txt +++ b/tests/SnapshotTests/Config/snapshots/snap-v9.0/GlobalConfigTests.Type_override.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/Config/snapshots/snap-v9.0/LocalConfigTests.Override_global_config_locally.verified.txt b/tests/SnapshotTests/Config/snapshots/snap-v9.0/LocalConfigTests.Override_global_config_locally.verified.txt index 5abf49b883..a4b84a0889 100644 --- a/tests/SnapshotTests/Config/snapshots/snap-v9.0/LocalConfigTests.Override_global_config_locally.verified.txt +++ b/tests/SnapshotTests/Config/snapshots/snap-v9.0/LocalConfigTests.Override_global_config_locally.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "number"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/0Rjlo8wVsY.verified.txt b/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/0Rjlo8wVsY.verified.txt index 09ed51b947..819e985b71 100644 --- a/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/0Rjlo8wVsY.verified.txt +++ b/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/0Rjlo8wVsY.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/GeneralTests.No_stack_trace_recording.verified.txt b/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/GeneralTests.No_stack_trace_recording.verified.txt index 02233513de..ccf85bcec5 100644 --- a/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/GeneralTests.No_stack_trace_recording.verified.txt +++ b/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/GeneralTests.No_stack_trace_recording.verified.txt @@ -40,12 +40,36 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::Whatever.CustomerId)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; schema.Nullable = true; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/LZDZ0jdOF6.verified.txt b/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/LZDZ0jdOF6.verified.txt index f56bd2a9b5..b5265ad42b 100644 --- a/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/LZDZ0jdOF6.verified.txt +++ b/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/LZDZ0jdOF6.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/jXZ79bcjc9.verified.txt b/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/jXZ79bcjc9.verified.txt index ae07d648d1..85a274ab0b 100644 --- a/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/jXZ79bcjc9.verified.txt +++ b/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/jXZ79bcjc9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/r69L6MTLWN.verified.txt b/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/r69L6MTLWN.verified.txt index 304ce791c1..7f34e62069 100644 --- a/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/r69L6MTLWN.verified.txt +++ b/tests/SnapshotTests/GeneralStuff/snapshots/snap-v9.0/r69L6MTLWN.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + if (context.JsonTypeInfo.Type == typeof(global::System.Nullable)) { schema.Type = "string"; @@ -48,6 +60,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::System.Nullable)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/GeneralStuff/snapshots/snap-vAspNetCore8.0/GeneralTests.Can_specify_both_swashbuckle_filter_and_MapType_extension_method_generation_for_openapi.verified.txt b/tests/SnapshotTests/GeneralStuff/snapshots/snap-vAspNetCore8.0/GeneralTests.Can_specify_both_swashbuckle_filter_and_MapType_extension_method_generation_for_openapi.verified.txt index f6ad94b588..ae54de3b23 100644 --- a/tests/SnapshotTests/GeneralStuff/snapshots/snap-vAspNetCore8.0/GeneralTests.Can_specify_both_swashbuckle_filter_and_MapType_extension_method_generation_for_openapi.verified.txt +++ b/tests/SnapshotTests/GeneralStuff/snapshots/snap-vAspNetCore8.0/GeneralTests.Can_specify_both_swashbuckle_filter_and_MapType_extension_method_generation_for_openapi.verified.txt @@ -107,11 +107,29 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); return o; diff --git a/tests/SnapshotTests/GeneralStuff/snapshots/snap-vAspNetCore8.0/GeneralTests.Can_specify_swashbuckle_MapType_extension_method_generation_for_openapi.verified.txt b/tests/SnapshotTests/GeneralStuff/snapshots/snap-vAspNetCore8.0/GeneralTests.Can_specify_swashbuckle_MapType_extension_method_generation_for_openapi.verified.txt index 5849799b62..4d80c91bd3 100644 --- a/tests/SnapshotTests/GeneralStuff/snapshots/snap-vAspNetCore8.0/GeneralTests.Can_specify_swashbuckle_MapType_extension_method_generation_for_openapi.verified.txt +++ b/tests/SnapshotTests/GeneralStuff/snapshots/snap-vAspNetCore8.0/GeneralTests.Can_specify_swashbuckle_MapType_extension_method_generation_for_openapi.verified.txt @@ -34,11 +34,29 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); return o; diff --git a/tests/SnapshotTests/OpenApi/OpenApiTests.cs b/tests/SnapshotTests/OpenApi/OpenApiTests.cs index b811f1726a..e7ffe3c4db 100644 --- a/tests/SnapshotTests/OpenApi/OpenApiTests.cs +++ b/tests/SnapshotTests/OpenApi/OpenApiTests.cs @@ -171,4 +171,24 @@ public partial class MyVo { } .WithSource(source) .RunOn(TargetFramework.AspNetCore9_0); } + + [Fact] + public async Task Generates_OpenApiMappingExtensionMethod_for_collections() + { + var source = + $$""" + using System; + using System.Collections.Generic; + using Vogen; + + [assembly: VogenDefaults(openApiSchemaCustomizations: OpenApiSchemaCustomizations.GenerateOpenApiMappingExtensionMethod)] + + [ValueObject] + public partial class MyVoString { } + """; + + await new SnapshotRunner() + .WithSource(source) + .RunOn(TargetFramework.AspNetCore9_0); + } } diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_32176bb7ed8221dd.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_32176bb7ed8221dd.verified.txt index 427a6b5477..e5a0818f5b 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_32176bb7ed8221dd.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_32176bb7ed8221dd.verified.txt @@ -41,43 +41,139 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoFloat)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoDecimal)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoDouble)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoString)) { schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoBool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.@bool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoShort)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_999bbcbfced9b3f8.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_999bbcbfced9b3f8.verified.txt index 98b9d99cbf..842db3e7f4 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_999bbcbfced9b3f8.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_999bbcbfced9b3f8.verified.txt @@ -41,43 +41,139 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoFloat)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoDecimal)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoDouble)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoString)) { schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoBool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.@bool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoShort)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_c61bd4ba08e7d371.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_c61bd4ba08e7d371.verified.txt index e569d6e02a..dc68ad9d44 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_c61bd4ba08e7d371.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_c61bd4ba08e7d371.verified.txt @@ -41,43 +41,139 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoFloat)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoDecimal)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoDouble)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoString)) { schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoBool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(@bool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoShort)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_02b3c4469da8bcf3.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_02b3c4469da8bcf3.verified.txt index c8e7b3b11f..e69efff582 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_02b3c4469da8bcf3.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_02b3c4469da8bcf3.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "uuid"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "uuid" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_11919b072576dd0b.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_11919b072576dd0b.verified.txt index f3602913e6..dfaa647ec9 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_11919b072576dd0b.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_11919b072576dd0b.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_152db79a4a6294cc.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_152db79a4a6294cc.verified.txt index 870123b968..4b5a787e7e 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_152db79a4a6294cc.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_152db79a4a6294cc.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_180eab2724098a76.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_180eab2724098a76.verified.txt index 9b814d79a8..102695d895 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_180eab2724098a76.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_180eab2724098a76.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_27f9427d955e30d9.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_27f9427d955e30d9.verified.txt index 8e102147f6..3c79b22176 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_27f9427d955e30d9.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_27f9427d955e30d9.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "date-time"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "date-time" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_30c90460a412631d.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_30c90460a412631d.verified.txt index 9b814d79a8..102695d895 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_30c90460a412631d.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_30c90460a412631d.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_5cd412becf8e1bb9.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_5cd412becf8e1bb9.verified.txt index 01d6865f39..df1ddc7f1b 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_5cd412becf8e1bb9.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_5cd412becf8e1bb9.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_72da95b4a0a661aa.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_72da95b4a0a661aa.verified.txt index 4b81f5e3e3..a276f81b41 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_72da95b4a0a661aa.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_72da95b4a0a661aa.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_875ea8807fc42733.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_875ea8807fc42733.verified.txt index 6bebc274ad..28e2f8aa23 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_875ea8807fc42733.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_875ea8807fc42733.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_a208bec0efab2582.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_a208bec0efab2582.verified.txt index 4b81f5e3e3..a276f81b41 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_a208bec0efab2582.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_a208bec0efab2582.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "byte"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Format = "byte" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_a258602a645377ab.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_a258602a645377ab.verified.txt index 6bebc274ad..28e2f8aa23 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_a258602a645377ab.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_a258602a645377ab.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_d36819e608b8e6b4.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_d36819e608b8e6b4.verified.txt index f3602913e6..dfaa647ec9 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_d36819e608b8e6b4.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_d36819e608b8e6b4.verified.txt @@ -41,6 +41,18 @@ public static partial class VogenOpenApiExtensions schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_e2e6e6559d711eb6.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_e2e6e6559d711eb6.verified.txt index 0b23ed7686..a78d678667 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_e2e6e6559d711eb6.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-v9.0/OpenApiTests.Treats_IParsable_primitives_as_strings_e2e6e6559d711eb6.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_32176bb7ed8221dd.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_32176bb7ed8221dd.verified.txt index c7831c4cea..dab64fd685 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_32176bb7ed8221dd.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_32176bb7ed8221dd.verified.txt @@ -34,13 +34,37 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); return o; @@ -89,43 +113,139 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoInt)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoInt)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoFloat)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoFloat)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoFloat)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoDecimal)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoDecimal)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoDecimal)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoDouble)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoDouble)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoDouble)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoString)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.String; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoString)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.String }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoString)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.String }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoBool)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Boolean; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoBool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoBool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.@bool)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Boolean; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.@bool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.@bool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoShort)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoShort)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoShort)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_999bbcbfced9b3f8.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_999bbcbfced9b3f8.verified.txt index 1513c050f8..0aed041465 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_999bbcbfced9b3f8.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_999bbcbfced9b3f8.verified.txt @@ -34,13 +34,37 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); return o; @@ -89,43 +113,139 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoInt)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoInt)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoFloat)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoFloat)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoFloat)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoDecimal)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoDecimal)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoDecimal)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoDouble)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoDouble)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoDouble)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoString)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.String; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoString)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.String }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoString)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.String }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoBool)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Boolean; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoBool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoBool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.@bool)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Boolean; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.@bool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.@bool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoShort)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoShort)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoShort)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_c61bd4ba08e7d371.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_c61bd4ba08e7d371.verified.txt index 3e8de756a4..81da7e3bbb 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_c61bd4ba08e7d371.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore10.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_c61bd4ba08e7d371.verified.txt @@ -34,13 +34,37 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.String } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@bool>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@bool[]>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Boolean } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Array, Items = new global::Microsoft.OpenApi.OpenApiSchema { Type = global::Microsoft.OpenApi.JsonSchemaType.Number } }); return o; @@ -89,43 +113,139 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoInt)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoInt)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoFloat)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoFloat)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoFloat)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoDecimal)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoDecimal)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoDecimal)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoDouble)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoDouble)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoDouble)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number, Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoString)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.String; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoString)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.String }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoString)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.String }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoBool)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Boolean; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoBool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoBool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + if (context.JsonTypeInfo.Type == typeof(@bool)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Boolean; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(@bool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(@bool)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Boolean }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoShort)) { schema.Type = Microsoft.OpenApi.JsonSchemaType.Number; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoShort)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoShort)) + { + schema.Type = Microsoft.OpenApi.JsonSchemaType.Array; + schema.Items = new Microsoft.OpenApi.OpenApiSchema { Type = Microsoft.OpenApi.JsonSchemaType.Number }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_999bbcbfced9b3f8.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_999bbcbfced9b3f8.verified.txt index 9a2c6007e0..eb6b9bb35e 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_999bbcbfced9b3f8.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_999bbcbfced9b3f8.verified.txt @@ -107,11 +107,29 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); return o; diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_c61bd4ba08e7d371.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_c61bd4ba08e7d371.verified.txt index f6ad94b588..ae54de3b23 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_c61bd4ba08e7d371.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_both_filter_and_MapType_extension_method_c61bd4ba08e7d371.verified.txt @@ -107,11 +107,29 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); return o; diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_32176bb7ed8221dd.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_32176bb7ed8221dd.verified.txt index 392ef437a1..f73e9bb619 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_32176bb7ed8221dd.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_32176bb7ed8221dd.verified.txt @@ -34,13 +34,37 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); return o; diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_999bbcbfced9b3f8.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_999bbcbfced9b3f8.verified.txt index a3b5920b48..7e1011f1d1 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_999bbcbfced9b3f8.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_999bbcbfced9b3f8.verified.txt @@ -34,13 +34,37 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); return o; diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_c61bd4ba08e7d371.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_c61bd4ba08e7d371.verified.txt index aba61c05d3..5b14827a21 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_c61bd4ba08e7d371.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Generates_extension_method_for_mapping_types_c61bd4ba08e7d371.verified.txt @@ -34,13 +34,37 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@bool>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@bool[]>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); return o; diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Treats_custom_IParsable_as_string.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Treats_custom_IParsable_as_string.verified.txt index 3f597b336f..18a0808ceb 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Treats_custom_IParsable_as_string.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore8.0/SwashbuckleTests.Treats_custom_IParsable_as_string.verified.txt @@ -34,6 +34,9 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); return o; diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_for_collections.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_for_collections.verified.txt new file mode 100644 index 0000000000..e76cc4a7d4 --- /dev/null +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_OpenApiMappingExtensionMethod_for_collections.verified.txt @@ -0,0 +1,647 @@ +[ +// ------------------------------------------------------------------------------ +// +// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen) +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ + +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0618 + +// Suppress warnings for 'Override methods on comparable types'. +#pragma warning disable CA1036 + +// Suppress Error MA0097 : A class that implements IComparable or IComparable should override comparison operators +#pragma warning disable MA0097 + +// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.' +// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations. +#pragma warning disable CS8669, CS8632 + +#pragma warning disable CS8604 // Possible null reference argument. + +// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' +#pragma warning disable CS1591 + +// Suppress warnings about CS8767 : Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). +#pragma warning disable CS8767 + +public static partial class VogenOpenApiExtensions +{ + public static global::Microsoft.AspNetCore.OpenApi.OpenApiOptions MapVogenTypesIngenerator(this global::Microsoft.AspNetCore.OpenApi.OpenApiOptions options) + { + options.AddSchemaTransformer((schema, context, cancellationToken) => + { + if (context.JsonTypeInfo.Type == typeof(MyVoString)) + { + schema.Type = "string"; + } + + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + return global::System.Threading.Tasks.Task.CompletedTask; + }); + + return options; + } +} + + +// ------------------------------------------------------------------------------ +// +// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen) +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0618 +// Suppress warnings for 'Override methods on comparable types'. +#pragma warning disable CA1036 +// Suppress Error MA0097 : A class that implements IComparable or IComparable should override comparison operators +#pragma warning disable MA0097 +// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.' +// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations. +#pragma warning disable CS8669, CS8632 +#pragma warning disable CS8604 // Possible null reference argument. + +// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' +#pragma warning disable CS1591 +// Suppress warnings about CS8767 : Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). +#pragma warning disable CS8767 +namespace generator +{ + [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Vogen", "1.0.0.0")] + public class VogenTypesFactory : global::System.Text.Json.Serialization.JsonConverterFactory + { + public VogenTypesFactory() + { + } + + private static readonly global::System.Collections.Generic.Dictionary> _lookup = new global::System.Collections.Generic.Dictionary> + { + { + typeof(MyVoString), + new global::System.Lazy(() => new MyVoString.MyVoStringSystemTextJsonConverter()) + } + }; + public override bool CanConvert(global::System.Type typeToConvert) => _lookup.ContainsKey(typeToConvert); + public override global::System.Text.Json.Serialization.JsonConverter CreateConverter(global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) => _lookup[typeToConvert].Value; + } +} + +// ------------------------------------------------------------------------------ +// +// This code was generated by a source generator named Vogen (https://github.com/SteveDunn/Vogen) +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +// ------------------------------------------------------------------------------ +// Suppress warnings about [Obsolete] member usage in generated code. +#pragma warning disable CS0618 +// Suppress warnings for 'Override methods on comparable types'. +#pragma warning disable CA1036 +// Suppress Error MA0097 : A class that implements IComparable or IComparable should override comparison operators +#pragma warning disable MA0097 +// Suppress warning for 'The annotation for nullable reference types should only be used in code within a '#nullable' annotations context. Auto-generated code requires an explicit '#nullable' directive in source.' +// The generator copies signatures from the BCL, e.g. for `TryParse`, and some of those have nullable annotations. +#pragma warning disable CS8669, CS8632 +#pragma warning disable CS8604 // Possible null reference argument. + +// Suppress warnings about CS1591: Missing XML comment for publicly visible type or member 'Type_or_Member' +#pragma warning disable CS1591 +// Suppress warnings about CS8767 : Nullability of reference types in type of parameter doesn't match implicitly implemented member (possibly because of nullability attributes). +#pragma warning disable CS8767 +[global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Vogen", "1.0.0.0")] +[global::System.Text.Json.Serialization.JsonConverter(typeof(MyVoStringSystemTextJsonConverter))] +[global::System.ComponentModel.TypeConverter(typeof(MyVoStringTypeConverter))] +[global::System.Diagnostics.DebuggerTypeProxyAttribute(typeof(MyVoStringDebugView))] +[global::System.Diagnostics.DebuggerDisplayAttribute("Underlying type: global::System.String, Value = { _value }")] +public partial class MyVoString : global::System.IEquatable, global::System.IEquatable, global::System.IComparable, global::System.IComparable, global::System.IParsable, global::System.IConvertible +{ +#if DEBUG +private readonly global::System.Diagnostics.StackTrace _stackTrace = null!; +#endif +#if !VOGEN_NO_VALIDATION + private readonly global::System.Boolean _isInitialized; +#endif + private readonly global::System.String _value; + /// + /// Gets the underlying value if set, otherwise a is thrown. + /// + public global::System.String Value + { + [global::System.Diagnostics.DebuggerStepThroughAttribute] + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + get + { + EnsureInitialized(); + return _value; + } + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute] + [global::System.ComponentModel.EditorBrowsable(global::System.ComponentModel.EditorBrowsableState.Never)] + public MyVoString() + { +#if DEBUG + _stackTrace = new global::System.Diagnostics.StackTrace(); +#endif +#if !VOGEN_NO_VALIDATION + _isInitialized = false; +#endif + _value = default; + } + + [global::System.Diagnostics.DebuggerStepThroughAttribute] + private MyVoString(global::System.String value) + { + _value = value; +#if !VOGEN_NO_VALIDATION + _isInitialized = true; +#endif + } + + /// + /// Builds an instance from the provided underlying type. + /// + /// The underlying type. + /// An instance of this type. + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + public static MyVoString From(global::System.String value) + { + if (value is null) + { + ThrowHelper.ThrowWhenCreatedWithNull(); + return default !; + } + + return new MyVoString(value); + } + + /// + /// Tries to build an instance from the provided underlying type. + /// If a normalization method is provided, it will be called. + /// If validation is provided, and it fails, false will be returned. + /// + /// The underlying type. + /// An instance of the value object. + /// True if the value object can be built, otherwise false. + public static bool TryFrom( +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + global::System.String value, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)] +#endif + out MyVoString vo) + { + if (value is null) + { + vo = default; + return false; + } + + vo = new MyVoString(value); + return true; + } + + /// + /// Tries to build an instance from the provided underlying value. + /// If a normalization method is provided, it will be called. + /// If validation is provided, and it fails, an error will be returned. + /// + /// The primitive value. + /// A containing either the value object, or an error. + public static global::Vogen.ValueObjectOrError TryFrom(global::System.String value) + { + if (value is null) + { + return new global::Vogen.ValueObjectOrError(global::Vogen.Validation.Invalid("The value provided was null")); + } + + return new global::Vogen.ValueObjectOrError(new MyVoString(value)); + } + + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] +#if VOGEN_NO_VALIDATION +#pragma warning disable CS8775 + public bool IsInitialized() => true; +#pragma warning restore CS8775 +#else + public bool IsInitialized() => _isInitialized; +#endif + // only called internally when something has been deserialized into + // its primitive type. + private static MyVoString __Deserialize(global::System.String value) + { + if (value is null) + { + ThrowHelper.ThrowWhenCreatedWithNull(); + return default !; + } + + return new MyVoString(value); + } + + public global::System.Boolean Equals(MyVoString other) + { + if (ReferenceEquals(null, other)) + { + return false; + } + + // It's possible to create uninitialized instances via converters such as EfCore (HasDefaultValue), which call Equals. + // We treat anything uninitialized as not equal to anything, even other uninitialized instances of this type. + if (!IsInitialized() || !other.IsInitialized()) + return false; + if (ReferenceEquals(this, other)) + { + return true; + } + + return GetType() == other.GetType() && global::System.Collections.Generic.EqualityComparer.Default.Equals(Value, other.Value); + } + + public global::System.Boolean Equals(MyVoString other, global::System.Collections.Generic.IEqualityComparer comparer) + { + return comparer.Equals(this, other); + } + + public global::System.Boolean Equals(global::System.String primitive) + { + return Value.Equals(primitive); + } + + public global::System.Boolean Equals(global::System.String primitive, global::System.StringComparer comparer) + { + return comparer.Equals(Value, primitive); + } + + public override global::System.Boolean Equals(global::System.Object obj) + { + return Equals(obj as MyVoString); + } + + public static global::System.Boolean operator ==(MyVoString left, MyVoString right) => Equals(left, right); + public static global::System.Boolean operator !=(MyVoString left, MyVoString right) => !Equals(left, right); + public static global::System.Boolean operator ==(MyVoString left, global::System.String right) => left.Value.Equals(right); + public static global::System.Boolean operator ==(global::System.String left, MyVoString right) => right.Value.Equals(left); + public static global::System.Boolean operator !=(global::System.String left, MyVoString right) => !(left == right); + public static global::System.Boolean operator !=(MyVoString left, global::System.String right) => !(left == right); + public static explicit operator MyVoString(global::System.String value) => From(value); + public static explicit operator global::System.String(MyVoString value) => value.Value; + public int CompareTo(MyVoString other) + { + if (other is null) + return 1; + return Value.CompareTo(other.Value); + } + + public int CompareTo(object other) + { + if (other is null) + return 1; + if (other is MyVoString x) + return CompareTo(x); + ThrowHelper.ThrowArgumentException("Cannot compare to object as it is not of type MyVoString", nameof(other)); + return 0; + } + + /// + /// + /// + /// True if the value passes any validation (after running any optional normalization). + /// + public static global::System.Boolean TryParse( +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.NotNullWhen(true)] +#endif + global::System.String s, global::System.IFormatProvider provider, +#if NETCOREAPP3_0_OR_GREATER +[global::System.Diagnostics.CodeAnalysis.MaybeNullWhen(false)] +#endif + out MyVoString result) + { + if (s is null) + { + result = default; + return false; + } + + result = new MyVoString(s); + return true; + } + + /// + /// + /// + /// The value created via the method. + /// + /// Thrown when the value can be parsed, but is not valid. + public static MyVoString Parse(global::System.String s, global::System.IFormatProvider provider) + { + return From(s); + } + +#nullable disable +#nullable restore +#nullable disable + /// + public System.TypeCode GetTypeCode() + { + return IsInitialized() ? Value.GetTypeCode() : default; + } + + /// + bool System.IConvertible.ToBoolean(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToBoolean(provider) : default; + } + + /// + byte System.IConvertible.ToByte(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToByte(provider) : default; + } + + /// + char System.IConvertible.ToChar(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToChar(provider) : default; + } + + /// + System.DateTime System.IConvertible.ToDateTime(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDateTime(provider) : default; + } + + /// + decimal System.IConvertible.ToDecimal(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDecimal(provider) : default; + } + + /// + double System.IConvertible.ToDouble(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToDouble(provider) : default; + } + + /// + short System.IConvertible.ToInt16(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt16(provider) : default; + } + + /// + int System.IConvertible.ToInt32(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt32(provider) : default; + } + + /// + long System.IConvertible.ToInt64(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToInt64(provider) : default; + } + + /// + sbyte System.IConvertible.ToSByte(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToSByte(provider) : default; + } + + /// + float System.IConvertible.ToSingle(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToSingle(provider) : default; + } + + /// + object System.IConvertible.ToType(global::System.Type @type, global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToType(@type, provider) : default; + } + + /// + ushort System.IConvertible.ToUInt16(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt16(provider) : default; + } + + /// + uint System.IConvertible.ToUInt32(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt32(provider) : default; + } + + /// + ulong System.IConvertible.ToUInt64(global::System.IFormatProvider provider) + { + return IsInitialized() ? (Value as System.IConvertible).ToUInt64(provider) : default; + } + +#nullable restore + public override global::System.Int32 GetHashCode() + { + unchecked // Overflow is fine, just wrap + { + global::System.Int32 hash = (global::System.Int32)2166136261; + hash = (hash * 16777619) ^ GetType().GetHashCode(); + hash = (hash * 16777619) ^ global::System.Collections.Generic.EqualityComparer.Default.GetHashCode(Value); + return hash; + } + } + + /// + public override global::System.String ToString() => IsInitialized() ? Value.ToString() ?? "" : "[UNINITIALIZED]"; + /// + public global::System.String ToString(global::System.IFormatProvider provider) => IsInitialized() ? Value.ToString(provider) ?? "" : "[UNINITIALIZED]"; + [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] + private void EnsureInitialized() + { + if (!IsInitialized()) + { +#if DEBUG + ThrowHelper.ThrowWhenNotInitialized(_stackTrace); +#else + ThrowHelper.ThrowWhenNotInitialized(); +#endif + } + } + +#nullable disable + /// + /// Converts a MyVoString to or from JSON. + /// + public partial class MyVoStringSystemTextJsonConverter : global::System.Text.Json.Serialization.JsonConverter + { + public override MyVoString Read(ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) + { + return DeserializeJson(reader.GetString()); + } + + public override void Write(global::System.Text.Json.Utf8JsonWriter writer, MyVoString value, global::System.Text.Json.JsonSerializerOptions options) + { + writer.WriteStringValue(value.Value); + } + +#if NET6_0_OR_GREATER + public override MyVoString ReadAsPropertyName(ref global::System.Text.Json.Utf8JsonReader reader, global::System.Type typeToConvert, global::System.Text.Json.JsonSerializerOptions options) + { + return DeserializeJson(reader.GetString()); + } + + public override void WriteAsPropertyName(global::System.Text.Json.Utf8JsonWriter writer, MyVoString value, global::System.Text.Json.JsonSerializerOptions options) + { + writer.WritePropertyName(value.Value); + } +#endif +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + private static void ThrowJsonExceptionWhenValidationFails(global::Vogen.Validation validation) + { + var e = ThrowHelper.CreateValidationException(validation); + throw new global::System.Text.Json.JsonException(null, e); + } + + private static void ThrowJsonExceptionWhenNull(global::System.String value) + { + if (value == null) + { + var e = ThrowHelper.CreateCannotBeNullException(); + throw new global::System.Text.Json.JsonException(null, e); + } + } + + private static MyVoString DeserializeJson(global::System.String value) + { + ThrowJsonExceptionWhenNull(value); + return new MyVoString(value); + } + } + +#nullable restore +#nullable disable + class MyVoStringTypeConverter : global::System.ComponentModel.TypeConverter + { + public override global::System.Boolean CanConvertFrom(global::System.ComponentModel.ITypeDescriptorContext context, global::System.Type sourceType) + { + return sourceType == typeof(global::System.String) || base.CanConvertFrom(context, sourceType); + } + + public override global::System.Object ConvertFrom(global::System.ComponentModel.ITypeDescriptorContext context, global::System.Globalization.CultureInfo culture, global::System.Object value) + { + var stringValue = value as global::System.String; + if (stringValue != null) + { + return MyVoString.__Deserialize(stringValue); + } + + return base.ConvertFrom(context, culture, value); + } + + public override bool CanConvertTo(global::System.ComponentModel.ITypeDescriptorContext context, global::System.Type sourceType) + { + return sourceType == typeof(global::System.String) || base.CanConvertTo(context, sourceType); + } + + public override object ConvertTo(global::System.ComponentModel.ITypeDescriptorContext context, global::System.Globalization.CultureInfo culture, global::System.Object value, global::System.Type destinationType) + { + if (value is MyVoString idValue) + { + if (destinationType == typeof(global::System.String)) + { + return idValue.Value; + } + } + + return base.ConvertTo(context, culture, value, destinationType); + } + } + +#nullable restore + internal sealed class MyVoStringDebugView + { + private readonly MyVoString _t; + MyVoStringDebugView(MyVoString t) + { + _t = t; + } + + public global::System.String UnderlyingType => "global::System.String"; + public global::System.String Value => _t.Value; + public global::System.String Conversions => @"[global::System.Text.Json.Serialization.JsonConverter(typeof(MyVoStringSystemTextJsonConverter))] +[global::System.ComponentModel.TypeConverter(typeof(MyVoStringTypeConverter))] +"; + } + + static class ThrowHelper + { +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowInvalidOperationException(string message) => throw new global::System.InvalidOperationException(message); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowArgumentException(string message, string arg) => throw new global::System.ArgumentException(message, arg); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenCreatedWithNull() => throw CreateCannotBeNullException(); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenNotInitialized() => throw CreateValidationException("Use of uninitialized Value Object."); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenNotInitialized(global::System.Diagnostics.StackTrace stackTrace) => throw CreateValidationException("Use of uninitialized Value Object at: " + stackTrace ?? ""); +#if NETCOREAPP3_0_OR_GREATER + [global::System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute] +#endif + internal static void ThrowWhenValidationFails(global::Vogen.Validation validation) + { + throw CreateValidationException(validation); + } + + internal static global::System.Exception CreateValidationException(string message) => new global::Vogen.ValueObjectValidationException(message); + internal static global::System.Exception CreateCannotBeNullException() => new global::Vogen.ValueObjectValidationException("Cannot create a value object with null."); + internal static global::System.Exception CreateValidationException(global::Vogen.Validation validation) + { + var ex = CreateValidationException(validation.ErrorMessage); + if (validation.Data != null) + { + foreach (var kvp in validation.Data) + { + ex.Data[kvp.Key] = kvp.Value; + } + } + + return ex; + } + } +} +] \ No newline at end of file diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_32176bb7ed8221dd.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_32176bb7ed8221dd.verified.txt index c9aefb7094..41276c9342 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_32176bb7ed8221dd.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_32176bb7ed8221dd.verified.txt @@ -34,13 +34,37 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); return o; @@ -89,43 +113,139 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoFloat)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoDecimal)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoDouble)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoString)) { schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoBool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.@bool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::@double.MyVoShort)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::@double.MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::@double.MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_999bbcbfced9b3f8.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_999bbcbfced9b3f8.verified.txt index 411ef81331..c57c69290e 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_999bbcbfced9b3f8.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_999bbcbfced9b3f8.verified.txt @@ -34,13 +34,37 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); return o; @@ -89,43 +113,139 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoFloat)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoDecimal)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoDouble)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoString)) { schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoBool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.@bool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(global::MyNamespace.MyVoShort)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_c61bd4ba08e7d371.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_c61bd4ba08e7d371.verified.txt index a37ed78950..6fbc85f4a5 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_c61bd4ba08e7d371.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Generates_both_OpenApiMappingExtensionMethod_SwaggerMappingExtensionMethod_c61bd4ba08e7d371.verified.txt @@ -34,13 +34,37 @@ public static class VogenSwashbuckleExtensions public static global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions MapVogenTypesIngenerator(this global::Swashbuckle.AspNetCore.SwaggerGen.SwaggerGenOptions o) { global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "string", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@bool>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType<@bool[]>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean", Nullable = false } }); global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); +global::Microsoft.Extensions.DependencyInjection.SwaggerGenOptionsExtensions.MapType>(o, () => new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "array", Items = new global::Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Nullable = false } }); return o; @@ -89,43 +113,139 @@ public static partial class VogenOpenApiExtensions schema.Format = "int32"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoInt)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "integer", Format = "int32" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoFloat)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoFloat)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoDecimal)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoDecimal)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoDouble)) { schema.Type = "number"; schema.Format = "double"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoDouble)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number", Format = "double" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoString)) { schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoString)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoBool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoBool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(@bool)) { schema.Type = "boolean"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(@bool)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "boolean" }; + } + if (context.JsonTypeInfo.Type == typeof(MyVoShort)) { schema.Type = "number"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(MyVoShort)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "number" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Treats_custom_IParsable_as_string.verified.txt b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Treats_custom_IParsable_as_string.verified.txt index 658cd47901..9d9c40c7bc 100644 --- a/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Treats_custom_IParsable_as_string.verified.txt +++ b/tests/SnapshotTests/OpenApi/snapshots/snap-vAspNetCore9.0/OpenApiTests.Treats_custom_IParsable_as_string.verified.txt @@ -40,6 +40,18 @@ public static partial class VogenOpenApiExtensions schema.Type = "string"; } + if (context.JsonTypeInfo.Type.IsArray && context.JsonTypeInfo.Type.GetElementType() == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + + if (context.JsonTypeInfo.Type.IsGenericType && context.JsonTypeInfo.Type.GetGenericArguments().Length == 1 && context.JsonTypeInfo.Type.GetGenericArguments()[0] == typeof(global::MyNamespace.MyVo)) + { + schema.Type = "array"; + schema.Items = new Microsoft.OpenApi.Models.OpenApiSchema { Type = "string" }; + } + return global::System.Threading.Tasks.Task.CompletedTask; }); diff --git a/tmp b/tmp new file mode 100644 index 0000000000..e69de29bb2