Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet new webapi template : package reference Swashbuckle.AspNetCore version isn't the last one #52246

Closed
1 task done
diplomegalo opened this issue Nov 21, 2023 · 5 comments
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-templates
Milestone

Comments

@diplomegalo
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Project created with dotnet new cli reference an old version of Swashbuckle.AspNetCore.

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net6.0,net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <InvariantGlobalization>true</InvariantGlobalization>
    <RootNamespace>web_8</RootNamespace>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
  </ItemGroup>

</Project>

Expected Behavior

The csproj should reference the version 6.5.0 :

<Project Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>net6.0,net8.0</TargetFramework>
    <Nullable>enable</Nullable>
    <ImplicitUsings>enable</ImplicitUsings>
    <InvariantGlobalization>true</InvariantGlobalization>
    <RootNamespace>web_8</RootNamespace>
  </PropertyGroup>

  <ItemGroup>
    <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.0" />
    <PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" /><!-- should reference the 6.5.0 version -->
  </ItemGroup>

</Project>

Steps To Reproduce

dotnet new webapi

Exceptions (if any)

No response

.NET Version

8.0.100

Anything else?

I suggest you to change the SwashbuckleAspNetCoreVersion value to 6.5.0.

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Nov 21, 2023
@captainsafia
Copy link
Member

@diplomegalo Thanks for opening this issue!

We typically upgrade the Swashbuckle.AspNetCore version after we've had the chance to test with the new iteration. We weren't able to get to this the last time Swashbuckle.AspNetCore was updated.

Updating the version will only affect .NET 9 and beyond at this point, so we'll wait to here more feedback on the value of this before we do so. Outside that, it's fairly easy for developers to upgrade the version themselves so this is low-pri.

@captainsafia captainsafia added this to the Backlog milestone Dec 19, 2023
@ghost
Copy link

ghost commented Dec 19, 2023

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@ghost
Copy link

ghost commented Mar 20, 2024

Tried upgrading to Swashbuckle.AspNetCore 6.5.0 to fix DateOnly serialisation but it breaks Swagger.json as mentioned in this Swashbuckle comment

dotnet --version
8.0.200

@captainsafia
Copy link
Member

@RandomBuffer Take a look at #54599 for our future plans in the OpenAPI effort.

I'm going to close this issue as we plan on removing Swashbuckle.AspNetCore from the templates.

As for the immediate problem you are running into with DateOnly, perhaps you can use a custom SchemaFilter to override the schema generated for DateOnly types?

@ghost
Copy link

ghost commented Mar 21, 2024

thanks @captainsafia yeah have read that plan, super exciting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates feature-templates
Projects
None yet
Development

No branches or pull requests

4 participants