From c203ed2384cdb1a8aab679dd171e8f866c8db5da Mon Sep 17 00:00:00 2001 From: Temo Nikolaishvili Date: Tue, 17 Feb 2026 12:06:18 +0400 Subject: [PATCH 1/5] swagger updates to only support 10.X version removed support for 9. Also updated Microsoft.OpenApi to 2.X version from 1.X versions. This change requires to have support for Swagger 10.x --- Directory.Build.props | 2 +- Directory.Packages.props | 19 +- .../AltaSoft.DomainPrimitives.Demo.csproj | 12 +- .../DomainPrimitivesDemo.csproj | 7 +- .../Helpers/MethodGeneratorHelper.cs | 162 ++++-------------- .../OpenApiHelperProcessor.cs | 4 - .../SwaggerGenOptionsExt.cs | 4 - ...sAndConverters#OpenApiHelper.g.verified.cs | 33 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 33 +--- ...lizationFormat#OpenApiHelper.g.verified.cs | 35 +--- ...lizationFormat#OpenApiHelper.g.verified.cs | 35 +--- ...lizationFormat#OpenApiHelper.g.verified.cs | 35 +--- ...lizationFormat#OpenApiHelper.g.verified.cs | 35 +--- ...lizationFormat#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...dJsonConverter#OpenApiHelper.g.verified.cs | 35 +--- ...dJsonConverter#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 55 +----- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 31 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 23 +-- ...rInternalClass#OpenApiHelper.g.verified.cs | 23 +-- ...ransformerCall#OpenApiHelper.g.verified.cs | 23 +-- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- ...sAndConverters#OpenApiHelper.g.verified.cs | 35 +--- 38 files changed, 76 insertions(+), 1195 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index b9f8fd3..e8e1344 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -11,7 +11,7 @@ Domain Primitives ALTA Software llc. Copyright © 2024 ALTA Software llc. - 7.1.0 + 7.2.0 diff --git a/Directory.Packages.props b/Directory.Packages.props index a650c58..cf90f96 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -8,6 +8,10 @@ + + + + @@ -16,19 +20,4 @@ - - - - - - - - - - - - - - - diff --git a/Examples/AltaSoft.DomainPrimitives.Demo/AltaSoft.DomainPrimitives.Demo.csproj b/Examples/AltaSoft.DomainPrimitives.Demo/AltaSoft.DomainPrimitives.Demo.csproj index 91582a8..f674d53 100644 --- a/Examples/AltaSoft.DomainPrimitives.Demo/AltaSoft.DomainPrimitives.Demo.csproj +++ b/Examples/AltaSoft.DomainPrimitives.Demo/AltaSoft.DomainPrimitives.Demo.csproj @@ -18,18 +18,10 @@ + + - - - - - - - - - - diff --git a/Examples/DomainPrimitivesDemo/DomainPrimitivesDemo.csproj b/Examples/DomainPrimitivesDemo/DomainPrimitivesDemo.csproj index 1e94e1c..c1e8c05 100644 --- a/Examples/DomainPrimitivesDemo/DomainPrimitivesDemo.csproj +++ b/Examples/DomainPrimitivesDemo/DomainPrimitivesDemo.csproj @@ -9,12 +9,9 @@ - - - - - + + diff --git a/src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs b/src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs index 0450ba0..4425600 100644 --- a/src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs +++ b/src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs @@ -1,6 +1,5 @@ using System.Collections.Generic; using System.Linq; -using System.Threading; using AltaSoft.DomainPrimitives.Generator.Extensions; using AltaSoft.DomainPrimitives.Generator.Models; using Microsoft.CodeAnalysis; @@ -27,14 +26,8 @@ internal static void AddOpenApiSchemas(string assemblyName, List var builder = new SourceCodeBuilder(); builder.AppendSourceHeader("AltaSoft DomainPrimitives Generator"); - builder.AppendLine("#if NET10_0_OR_GREATER", false) - .AppendLine("using Microsoft.OpenApi;", false) - .AppendLine("#else", false) - .AppendLine("using Microsoft.OpenApi.Models;", false) - .AppendLine("using Microsoft.OpenApi.Any;", false) - .AppendLine("#endif"); - var usings = types.ConvertAll(x => x.Namespace); + usings.Add("Microsoft.OpenApi"); usings.Add("System"); usings.Add("System.Collections.Frozen"); usings.Add("System.Collections.Generic"); @@ -65,7 +58,6 @@ internal static void AddOpenApiSchemas(string assemblyName, List } builder.AppendLine("/// "); - builder.NewLine().AppendLine("#if NET10_0_OR_GREATER", false); builder.AppendLine("public static FrozenDictionary Schemas = new Dictionary()") .OpenBracket(); @@ -129,90 +121,8 @@ void AddMapping() builder.Rollback(builder.GetNewLineLength() + 1).NewLine(); builder.CloseBracketWithString(".ToFrozenDictionary();"); - builder.NewLine(); - builder.AppendLine("#else", false); - - builder.AppendLine("public static FrozenDictionary Schemas = new Dictionary()") - .OpenBracket(); - - ProcessOldVersionOpenApi(types, builder, context.CancellationToken); - - builder.Rollback(builder.GetNewLineLength() + 1).NewLine(); - builder.CloseBracketWithString(".ToFrozenDictionary();"); - builder.AppendLine("#endif", false); - builder.CloseBracket(); context.AddSource("OpenApiHelper.g.cs", builder.ToString()); - - return; - - static void ProcessOldVersionOpenApi(List types, SourceCodeBuilder builder, CancellationToken cancellationToken) - { - foreach (var data in types) - { - var (typeName, format) = data.PrimitiveTypeSymbol.GetOldOpenApiTypeAndFormat(); - - // Get the XML documentation comment for the namedTypeSymbol - var xmlDocumentation = data.TypeSymbol.GetDocumentationCommentXml(cancellationToken: cancellationToken); - - AddOldMapping(false); - - if (data.TypeSymbol.IsValueType) - { - builder.NewLine(); - AddOldMapping(true); - } - - continue; - - void AddOldMapping(bool isNullable) - { - builder.OpenBracket(); - - builder.Append("typeof(").Append(data.ClassName).AppendIf(isNullable, "?").AppendLine("),"); - - builder.Append("new OpenApiSchema") - .OpenBracket() - .Append("Type = ").Append(Quote(typeName)).AppendLine(","); - - if (!string.IsNullOrEmpty(format)) - builder.Append("Format = ").Append(QuoteAndEscape(data.SerializationFormat ?? format)).AppendLine(","); - - if (isNullable) - builder.AppendLine("Nullable = true,"); - - var title = isNullable ? $"Nullable<{data.ClassName}>" : data.ClassName; - - builder.Append("Title = ").Append(Quote(title)).AppendLine(","); - - if (!string.IsNullOrEmpty(xmlDocumentation)) - { - var xmlDoc = new System.Xml.XmlDocument(); - xmlDoc.LoadXml(xmlDocumentation); - - // Select the node - var summaryNode = xmlDoc.SelectSingleNode("member/summary"); - - if (summaryNode is not null) - { - builder.Append("Description = @").Append(Quote(summaryNode.InnerText.Trim())).AppendLine(","); - } - - var example = xmlDoc.SelectSingleNode("member/example"); - if (example is not null) - { - var exampleValue = example.InnerText.Trim().Replace("\"", "\\\""); - builder.Append("Example = new OpenApiString(").Append("\"" + exampleValue + "\"").AppendLine("),"); - } - } - - builder.Length -= SourceCodeBuilder.s_newLineLength + 1; - builder.NewLine(); - builder.AppendLine("}"); - builder.CloseBracketWithComma(); - } - } - } } /// @@ -872,20 +782,20 @@ public static void GenerateParsable(GeneratorData data, SourceCodeBuilder builde builder.Append("s"); } else - if (isChar) - { - builder.Append("char.Parse(s)"); - } - else - if (isBool) - { - builder.Append("bool.Parse(s)"); - } - else - { - builder.Append($"{underlyingType}.") - .AppendIfElse(format is null, "Parse(s, provider)", $"ParseExact(s, {QuoteAndEscape(format!)}, provider)"); - } + if (isChar) + { + builder.Append("char.Parse(s)"); + } + else + if (isBool) + { + builder.Append("bool.Parse(s)"); + } + else + { + builder.Append($"{underlyingType}.") + .AppendIfElse(format is null, "Parse(s, provider)", $"ParseExact(s, {QuoteAndEscape(format!)}, provider)"); + } builder.AppendLine(!data.GenerateImplicitOperators ? ");" : ";"); @@ -900,26 +810,26 @@ public static void GenerateParsable(GeneratorData data, SourceCodeBuilder builde builder.AppendLine("if (s is null)"); } else - if (isChar) - { - builder.AppendLine("if (!char.TryParse(s, out var value))"); - } - else - if (isBool) - { - builder.AppendLine("if (!bool.TryParse(s, out var value))"); - } - else - { - var style = ""; - if (format is not null) + if (isChar) { - style = data.UnderlyingType == DomainPrimitiveUnderlyingType.TimeSpan ? "TimeSpanStyles.None" : "DateTimeStyles.None"; + builder.AppendLine("if (!char.TryParse(s, out var value))"); } + else + if (isBool) + { + builder.AppendLine("if (!bool.TryParse(s, out var value))"); + } + else + { + var style = ""; + if (format is not null) + { + style = data.UnderlyingType == DomainPrimitiveUnderlyingType.TimeSpan ? "TimeSpanStyles.None" : "DateTimeStyles.None"; + } - builder.AppendIf(format is null, $"if (!{underlyingType}.TryParse(s, provider, out var value))") - .AppendIf(format is not null, $"if (!{underlyingType}.TryParseExact(s, {QuoteAndEscape(format)}, provider, {style}, out var value))"); - } + builder.AppendIf(format is null, $"if (!{underlyingType}.TryParse(s, provider, out var value))") + .AppendIf(format is not null, $"if (!{underlyingType}.TryParseExact(s, {QuoteAndEscape(format)}, provider, {style}, out var value))"); + } builder.OpenBracket() .AppendLine("result = default;") @@ -1130,10 +1040,10 @@ public static void GenerateIXmlSerializableMethods(GeneratorData data, SourceCod if (string.Equals(data.PrimitiveTypeFriendlyName, "string", System.StringComparison.Ordinal)) builder.AppendLine($"public void WriteXml(XmlWriter writer) => writer.WriteString({data.FieldName});"); else - if (data.SerializationFormat is null) - builder.AppendLine($"public void WriteXml(XmlWriter writer) => writer.WriteValue((({data.PrimitiveTypeFriendlyName}){data.FieldName}).ToXmlString());"); - else - builder.AppendLine($"public void WriteXml(XmlWriter writer) => writer.WriteString({data.FieldName}.ToString({QuoteAndEscape(data.SerializationFormat)}));"); + if (data.SerializationFormat is null) + builder.AppendLine($"public void WriteXml(XmlWriter writer) => writer.WriteValue((({data.PrimitiveTypeFriendlyName}){data.FieldName}).ToXmlString());"); + else + builder.AppendLine($"public void WriteXml(XmlWriter writer) => writer.WriteString({data.FieldName}.ToString({QuoteAndEscape(data.SerializationFormat)}));"); builder.NewLine(); } diff --git a/src/AltaSoft.DomainPrimitives.OpenApiExtensions/OpenApiHelperProcessor.cs b/src/AltaSoft.DomainPrimitives.OpenApiExtensions/OpenApiHelperProcessor.cs index def8030..2867391 100644 --- a/src/AltaSoft.DomainPrimitives.OpenApiExtensions/OpenApiHelperProcessor.cs +++ b/src/AltaSoft.DomainPrimitives.OpenApiExtensions/OpenApiHelperProcessor.cs @@ -3,11 +3,7 @@ using System.Collections.Generic; using System.Linq; using System.Reflection; -#if NET10_0_OR_GREATER using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -#endif namespace AltaSoft.DomainPrimitives.OpenApiExtensions; diff --git a/src/AltaSoft.DomainPrimitives.SwaggerExtensions/SwaggerGenOptionsExt.cs b/src/AltaSoft.DomainPrimitives.SwaggerExtensions/SwaggerGenOptionsExt.cs index 4d90f4f..67e184b 100644 --- a/src/AltaSoft.DomainPrimitives.SwaggerExtensions/SwaggerGenOptionsExt.cs +++ b/src/AltaSoft.DomainPrimitives.SwaggerExtensions/SwaggerGenOptionsExt.cs @@ -4,11 +4,7 @@ using System.Runtime.CompilerServices; using AltaSoft.DomainPrimitives.OpenApiExtensions; using Microsoft.Extensions.DependencyInjection; -#if NET10_0_OR_GREATER using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -#endif using Swashbuckle.AspNetCore.SwaggerGen; // ReSharper disable UnusedMember.Global diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.BoolValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.BoolValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index e44a13f..5a0ffcc 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.BoolValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.BoolValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -50,28 +43,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(BoolValue), - new OpenApiSchema - { - Type = "boolean", - Title = "BoolValue" - } - }, - - { - typeof(BoolValue?), - new OpenApiSchema - { - Type = "boolean", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.ByteValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.ByteValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index bf52f08..741700e 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.ByteValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.ByteValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(ByteValue), - new OpenApiSchema - { - Type = "integer", - Format = "byte", - Title = "ByteValue" - } - }, - - { - typeof(ByteValue?), - new OpenApiSchema - { - Type = "integer", - Format = "byte", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CharValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CharValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index f53945a..1de2794 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CharValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CharValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,28 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(CharValue), - new OpenApiSchema - { - Type = "string", - Title = "CharValue" - } - }, - - { - typeof(CharValue?), - new OpenApiSchema - { - Type = "string", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateOnly_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateOnly_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs index 0a7ab1e..ee4354d 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateOnly_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateOnly_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(CustomDateOnly), - new OpenApiSchema - { - Type = "string", - Format = "yyyyMMdd", - Title = "CustomDateOnly" - } - }, - - { - typeof(CustomDateOnly?), - new OpenApiSchema - { - Type = "string", - Format = "yyyyMMdd", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateTimeOffset_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateTimeOffset_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs index ca7a9c0..85382f9 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateTimeOffset_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateTimeOffset_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(CustomDateTimeOffset), - new OpenApiSchema - { - Type = "string", - Format = "yyyyMMdd", - Title = "CustomDateTimeOffset" - } - }, - - { - typeof(CustomDateTimeOffset?), - new OpenApiSchema - { - Type = "string", - Format = "yyyyMMdd", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateTime_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateTime_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs index 798086e..1b3abfc 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateTime_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomDateTime_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(CustomDateTime), - new OpenApiSchema - { - Type = "string", - Format = "yyyyMMdd_HHmmss", - Title = "CustomDateTime" - } - }, - - { - typeof(CustomDateTime?), - new OpenApiSchema - { - Type = "string", - Format = "yyyyMMdd_HHmmss", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomTimeOnly_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomTimeOnly_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs index 2d4e593..192aebf 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomTimeOnly_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomTimeOnly_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(CustomTimeOnly), - new OpenApiSchema - { - Type = "string", - Format = "HHmmss", - Title = "CustomTimeOnly" - } - }, - - { - typeof(CustomTimeOnly?), - new OpenApiSchema - { - Type = "string", - Format = "HHmmss", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomTimeSpan_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomTimeSpan_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs index 2a09f96..78ad5b9 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomTimeSpan_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.CustomTimeSpan_GeneratesAllInterfacesAndConvertersWithSerializationFormat#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(CustomTimeSpan), - new OpenApiSchema - { - Type = "integer", - Format = "hh\\:mm", - Title = "CustomTimeSpan" - } - }, - - { - typeof(CustomTimeSpan?), - new OpenApiSchema - { - Type = "integer", - Format = "hh\\:mm", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateOnlyValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateOnlyValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index 96ee744..7c44547 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateOnlyValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateOnlyValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(DateOnlyValue), - new OpenApiSchema - { - Type = "string", - Format = "date", - Title = "DateOnlyValue" - } - }, - - { - typeof(DateOnlyValue?), - new OpenApiSchema - { - Type = "string", - Format = "date", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateTimeOffsetValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateTimeOffsetValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index b4126e1..2e0fd0d 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateTimeOffsetValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateTimeOffsetValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(DateTimeOffsetValue), - new OpenApiSchema - { - Type = "string", - Format = "date-time", - Title = "DateTimeOffsetValue" - } - }, - - { - typeof(DateTimeOffsetValue?), - new OpenApiSchema - { - Type = "string", - Format = "date-time", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateTimeValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateTimeValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index 4650ed6..8453651 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateTimeValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DateTimeValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(DateTimeValue), - new OpenApiSchema - { - Type = "string", - Format = "date-time", - Title = "DateTimeValue" - } - }, - - { - typeof(DateTimeValue?), - new OpenApiSchema - { - Type = "string", - Format = "date-time", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DecimalValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DecimalValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index e73583c..4044381 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DecimalValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DecimalValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(DecimalValue), - new OpenApiSchema - { - Type = "number", - Format = "decimal", - Title = "DecimalValue" - } - }, - - { - typeof(DecimalValue?), - new OpenApiSchema - { - Type = "number", - Format = "decimal", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DomainPrimitiveWithoutJsonConverters_ShouldNotAddJsonConverter#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DomainPrimitiveWithoutJsonConverters_ShouldNotAddJsonConverter#OpenApiHelper.g.verified.cs index 3e7d6a2..2992a8c 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DomainPrimitiveWithoutJsonConverters_ShouldNotAddJsonConverter#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DomainPrimitiveWithoutJsonConverters_ShouldNotAddJsonConverter#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(WithoutJsonConverterValue), - new OpenApiSchema - { - Type = "integer", - Format = "uint32", - Title = "WithoutJsonConverterValue" - } - }, - - { - typeof(WithoutJsonConverterValue?), - new OpenApiSchema - { - Type = "integer", - Format = "uint32", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DomainPrimitiveWithoutTypeConverters_ShouldNotAddJsonConverter#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DomainPrimitiveWithoutTypeConverters_ShouldNotAddJsonConverter#OpenApiHelper.g.verified.cs index 7b91217..e141f1c 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DomainPrimitiveWithoutTypeConverters_ShouldNotAddJsonConverter#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DomainPrimitiveWithoutTypeConverters_ShouldNotAddJsonConverter#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(WithoutTypeConverterValue), - new OpenApiSchema - { - Type = "integer", - Format = "uint32", - Title = "WithoutTypeConverterValue" - } - }, - - { - typeof(WithoutTypeConverterValue?), - new OpenApiSchema - { - Type = "integer", - Format = "uint32", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DoubleValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DoubleValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index 3449096..f7ac71a 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DoubleValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.DoubleValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(DoubleValue), - new OpenApiSchema - { - Type = "number", - Format = "double", - Title = "DoubleValue" - } - }, - - { - typeof(DoubleValue?), - new OpenApiSchema - { - Type = "number", - Format = "double", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.FloatValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.FloatValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index 0e68331..d0b38c0 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.FloatValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.FloatValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(FloatValue), - new OpenApiSchema - { - Type = "number", - Format = "single", - Title = "FloatValue" - } - }, - - { - typeof(FloatValue?), - new OpenApiSchema - { - Type = "number", - Format = "single", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.GuidValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.GuidValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index b2ad80a..f306d2a 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.GuidValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.GuidValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(GuidValue), - new OpenApiSchema - { - Type = "string", - Format = "uuid", - Title = "GuidValue" - } - }, - - { - typeof(GuidValue?), - new OpenApiSchema - { - Type = "string", - Format = "uuid", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.Int16Value_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.Int16Value_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index 889322d..ac58cc3 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.Int16Value_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.Int16Value_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(ShortValue), - new OpenApiSchema - { - Type = "integer", - Format = "int16", - Title = "ShortValue" - } - }, - - { - typeof(ShortValue?), - new OpenApiSchema - { - Type = "integer", - Format = "int16", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.IntOfIntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.IntOfIntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index af484e9..d7ca26a 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.IntOfIntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.IntOfIntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -40,8 +35,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -63,50 +56,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(IntValue), - new OpenApiSchema - { - Type = "integer", - Format = "int32", - Title = "IntValue" - } - }, - - { - typeof(IntValue?), - new OpenApiSchema - { - Type = "integer", - Format = "int32", - Nullable = true, - Title = "Nullable" - } - }, - { - typeof(IntOfIntValue), - new OpenApiSchema - { - Type = "integer", - Format = "int32", - Title = "IntOfIntValue" - } - }, - - { - typeof(IntOfIntValue?), - new OpenApiSchema - { - Type = "integer", - Format = "int32", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.IntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.IntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index e68a040..f6de41b 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.IntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.IntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(IntValue), - new OpenApiSchema - { - Type = "integer", - Format = "int32", - Title = "IntValue" - } - }, - - { - typeof(IntValue?), - new OpenApiSchema - { - Type = "integer", - Format = "int32", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.LongValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.LongValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index b3d5507..ba90cd4 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.LongValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.LongValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(LongValue), - new OpenApiSchema - { - Type = "integer", - Format = "int64", - Title = "LongValue" - } - }, - - { - typeof(LongValue?), - new OpenApiSchema - { - Type = "integer", - Format = "int64", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.SByteValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.SByteValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index 4a717a5..a04a4fc 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.SByteValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.SByteValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(SByteValue), - new OpenApiSchema - { - Type = "integer", - Format = "sbyte", - Title = "SByteValue" - } - }, - - { - typeof(SByteValue?), - new OpenApiSchema - { - Type = "integer", - Format = "sbyte", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringOfStringValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringOfStringValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index 2a31e5a..8046eab 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringOfStringValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringOfStringValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -40,8 +35,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -61,26 +54,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(StringValue), - new OpenApiSchema - { - Type = "string", - Title = "StringValue" - } - }, - { - typeof(StringOfStringValue), - new OpenApiSchema - { - Type = "string", - Title = "StringOfStringValue" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index e404dd7..b7a109a 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -50,18 +43,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(StringValue), - new OpenApiSchema - { - Type = "string", - Title = "StringValue" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_GeneratesAllInterfacesAndConvertersForInternalClass#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_GeneratesAllInterfacesAndConvertersForInternalClass#OpenApiHelper.g.verified.cs index 1ac3d79..271f125 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_GeneratesAllInterfacesAndConvertersForInternalClass#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_GeneratesAllInterfacesAndConvertersForInternalClass#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -50,18 +43,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(InternalStringValue), - new OpenApiSchema - { - Type = "string", - Title = "InternalStringValue" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithTransformerGeneratesTransformerCall#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithTransformerGeneratesTransformerCall#OpenApiHelper.g.verified.cs index 5fa8828..32ac159 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithTransformerGeneratesTransformerCall#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.StringValue_WithTransformerGeneratesTransformerCall#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -50,18 +43,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(TransformableString), - new OpenApiSchema - { - Type = "string", - Title = "TransformableString" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.TimeOnlyValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.TimeOnlyValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index 086a027..5764a39 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.TimeOnlyValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.TimeOnlyValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(TimeOnlyValue), - new OpenApiSchema - { - Type = "string", - Format = "HH:mm:ss", - Title = "TimeOnlyValue" - } - }, - - { - typeof(TimeOnlyValue?), - new OpenApiSchema - { - Type = "string", - Format = "HH:mm:ss", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.TimeSpanValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.TimeSpanValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index 5681fb7..8e6b731 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.TimeSpanValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.TimeSpanValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(TimeSpanValue), - new OpenApiSchema - { - Type = "integer", - Format = "int64", - Title = "TimeSpanValue" - } - }, - - { - typeof(TimeSpanValue?), - new OpenApiSchema - { - Type = "integer", - Format = "int64", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.UInt16Value_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.UInt16Value_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index 064ff89..3564bd5 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.UInt16Value_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.UInt16Value_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(UShortValue), - new OpenApiSchema - { - Type = "integer", - Format = "uint16", - Title = "UShortValue" - } - }, - - { - typeof(UShortValue?), - new OpenApiSchema - { - Type = "integer", - Format = "uint16", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.UIntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.UIntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index f6abecf..d78df23 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.UIntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.UIntValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(IntValue), - new OpenApiSchema - { - Type = "integer", - Format = "uint32", - Title = "IntValue" - } - }, - - { - typeof(IntValue?), - new OpenApiSchema - { - Type = "integer", - Format = "uint32", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } diff --git a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.ULongValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.ULongValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs index f7e21ef..133722f 100644 --- a/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.ULongValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs +++ b/tests/AltaSoft.DomainPrimitives.Generator.Tests/Snapshots/DomainPrimitiveGeneratorTest.ULongValue_GeneratesAllInterfacesAndConverters#OpenApiHelper.g.verified.cs @@ -8,13 +8,8 @@ #nullable enable -#if NET10_0_OR_GREATER -using Microsoft.OpenApi; -#else -using Microsoft.OpenApi.Models; -using Microsoft.OpenApi.Any; -#endif using AltaSoft.DomainPrimitives; +using Microsoft.OpenApi; using System; using System.Collections.Frozen; using System.Collections.Generic; @@ -37,8 +32,6 @@ public static class OpenApiHelper /// /// /// - -#if NET10_0_OR_GREATER public static FrozenDictionary Schemas = new Dictionary() { { @@ -51,30 +44,4 @@ public static class OpenApiHelper } } }.ToFrozenDictionary(); - -#else - public static FrozenDictionary Schemas = new Dictionary() - { - { - typeof(LongValue), - new OpenApiSchema - { - Type = "integer", - Format = "uint64", - Title = "LongValue" - } - }, - - { - typeof(LongValue?), - new OpenApiSchema - { - Type = "integer", - Format = "uint64", - Nullable = true, - Title = "Nullable" - } - } - }.ToFrozenDictionary(); -#endif } From e62d909d9e0247153ccdb48ec0b77b872a7cf161 Mon Sep 17 00:00:00 2001 From: Temo Nikolaishvili Date: Tue, 17 Feb 2026 12:51:57 +0400 Subject: [PATCH 2/5] Skill update --- .github/Skills/domainprimitive-builder/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/Skills/domainprimitive-builder/SKILL.md b/.github/Skills/domainprimitive-builder/SKILL.md index 9ad4f34..ab9ff45 100644 --- a/.github/Skills/domainprimitive-builder/SKILL.md +++ b/.github/Skills/domainprimitive-builder/SKILL.md @@ -251,7 +251,7 @@ Validation must be pure. # Validation Logic Rules -Validation defines domain invariants and must be explicit and domain-focused. +Validation defines domain invariants and must be explicit and domain-focused. Validatation Method must not call Transform. ## Preferred Error Return Style @@ -354,7 +354,7 @@ Templates must follow Structural Generator Safety Rules. ## Transform (Normalization) Rules -Optional normalization hook executed before Validate. +Optional normalization hook executed before Validate. Signature: From 54a13a5e90fa14decf087ad62e3bf0c0d413288c Mon Sep 17 00:00:00 2001 From: Temo Nikolaishvili Date: Wed, 25 Feb 2026 10:32:27 +0400 Subject: [PATCH 3/5] Changed version to 8.0.0 as it's breaking change --- Directory.Build.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Directory.Build.props b/Directory.Build.props index e8e1344..81f37f4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -11,7 +11,7 @@ Domain Primitives ALTA Software llc. Copyright © 2024 ALTA Software llc. - 7.2.0 + 8.0.0 From 8b73da5640ce152ba33ab039fff90d2fa9afda4c Mon Sep 17 00:00:00 2001 From: Teimuraz Nikolaishvili <47372530+temonk@users.noreply.github.com> Date: Wed, 25 Feb 2026 10:42:13 +0400 Subject: [PATCH 4/5] Update src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../Helpers/MethodGeneratorHelper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs b/src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs index a046c06..7b4426f 100644 --- a/src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs +++ b/src/AltaSoft.DomainPrimitives.Generator/Helpers/MethodGeneratorHelper.cs @@ -823,9 +823,9 @@ public static void GenerateParsable(GeneratorData data, SourceCodeBuilder builde style = data.UnderlyingType == DomainPrimitiveUnderlyingType.TimeSpan ? "TimeSpanStyles.None" : "DateTimeStyles.None"; } - builder.AppendIf(format is null, $"if (!{underlyingType}.TryParse(s, provider, out var value))") - .AppendIf(format is not null, $"if (!{underlyingType}.TryParseExact(s, {QuoteAndEscape(format)}, provider, {style}, out var value))"); - } + builder.AppendIf(format is null, $"if (!{underlyingType}.TryParse(s, provider, out var value))") + .AppendIf(format is not null, $"if (!{underlyingType}.TryParseExact(s, {QuoteAndEscape(format)}, provider, {style}, out var value))"); + } builder.OpenBracket() .AppendLine("result = default;") From f692c74aafc9e577103e52834ce0ba4b3e42e20c Mon Sep 17 00:00:00 2001 From: Teimuraz Nikolaishvili <47372530+temonk@users.noreply.github.com> Date: Wed, 25 Feb 2026 10:42:26 +0400 Subject: [PATCH 5/5] Update .github/Skills/domainprimitive-builder/SKILL.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/Skills/domainprimitive-builder/SKILL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/Skills/domainprimitive-builder/SKILL.md b/.github/Skills/domainprimitive-builder/SKILL.md index ab9ff45..5af6bf4 100644 --- a/.github/Skills/domainprimitive-builder/SKILL.md +++ b/.github/Skills/domainprimitive-builder/SKILL.md @@ -251,7 +251,7 @@ Validation must be pure. # Validation Logic Rules -Validation defines domain invariants and must be explicit and domain-focused. Validatation Method must not call Transform. +Validation defines domain invariants and must be explicit and domain-focused. Validation method must not call Transform. ## Preferred Error Return Style