From 28ca550e69f5d4811fb63be626f73959b4b2a908 Mon Sep 17 00:00:00 2001 From: Haik Date: Tue, 10 Feb 2026 11:19:15 +0400 Subject: [PATCH] downgrade OpenAPI spec from 3.1 to 3.0 for compatibility; update package version and dependencies --- SharedKernel.Demo/Program.cs | 5 +++++ src/SharedKernel/OpenApi/OpenApiExtensions.cs | 2 ++ src/SharedKernel/SharedKernel.csproj | 12 ++++++------ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/SharedKernel.Demo/Program.cs b/SharedKernel.Demo/Program.cs index 83e0f10..b3e08ad 100644 --- a/SharedKernel.Demo/Program.cs +++ b/SharedKernel.Demo/Program.cs @@ -1,6 +1,8 @@ +using System.Text.Json.Serialization; using DistributedCache.Extensions; using FileExporter.Extensions; using FluentMinimalApiMapper; +using GridifyExtensions.Models; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; using ResponseCrafter.Enums; @@ -108,6 +110,8 @@ return TypedResults.Ok(testTypes); }); +app.MapGet("test-query", ([FromQuery] long id) => TypedResults.Ok(id)); + app.MapHub("/hub"); app.LogStartSuccess(); @@ -120,6 +124,7 @@ public class TestTypes public AnimalType AnimalType { get; set; } = AnimalType.Dog; public required string JustText { get; set; } = "Hello"; public int JustNumber { get; set; } = 42; + public string? NullableText { get; set; } } public enum AnimalType diff --git a/src/SharedKernel/OpenApi/OpenApiExtensions.cs b/src/SharedKernel/OpenApi/OpenApiExtensions.cs index f487fa8..1cd33bd 100644 --- a/src/SharedKernel/OpenApi/OpenApiExtensions.cs +++ b/src/SharedKernel/OpenApi/OpenApiExtensions.cs @@ -4,6 +4,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using Microsoft.OpenApi; using SharedKernel.Helpers; using SharedKernel.OpenApi.Options; @@ -29,6 +30,7 @@ public static WebApplicationBuilder AddOpenApi(this WebApplicationBuilder builde builder.Services.AddOpenApi(document.GroupName, options => { + options.OpenApiVersion = OpenApiSpecVersion.OpenApi3_0; //TODO: Change someday when swagger will be upgraded options.AddDocumentTransformer(); options.AddDocument(document, openApiConfiguration); options.AddSchemaTransformer(); diff --git a/src/SharedKernel/SharedKernel.csproj b/src/SharedKernel/SharedKernel.csproj index 41b4c1c..2b1ab8f 100644 --- a/src/SharedKernel/SharedKernel.csproj +++ b/src/SharedKernel/SharedKernel.csproj @@ -8,13 +8,13 @@ Readme.md Pandatech MIT - 2.1.2 + 2.1.3 Pandatech.SharedKernel Pandatech Shared Kernel Library Pandatech, shared kernel, library, OpenAPI, Swagger, utilities, scalar Pandatech.SharedKernel provides centralized configurations, utilities, and extensions for ASP.NET Core projects. For more information refere to readme.md document. https://github.com/PandaTechAM/be-lib-sharedkernel - Swagger headers bug fix + Open API SPEC 3.1 downgraded to 3.0 for better compatability. Later when swagger will support we will bump it up. @@ -43,7 +43,7 @@ - + @@ -65,14 +65,14 @@ - + - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive