swagger-api / swagger-api/swagger-codegen

[aspnetcore] update or remove Swashbuckle.AspNetCore nuget package

Open
#8,932 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description / Suggestion

In the current server stub generated for aspnetcore / .NET Core 2.0, updating the nuget packages to their latest version available give code not compilable.
Regarding Swashbuckle, update to Swashbuckle.AspNetCore 4.x requires additionally to add Swashbuckle.AspNetCore.Annotations nuget package.
This one for the SwaggerOperation and SwaggerResponse attributes.

The Swashbuckle.AspNetCore is still necessary for the UseSwaggerUI() call in Startup class / Configure method.

Question: is this very necessary?

  1. As this alternative implementation says, what's the point in creating the schema for Swagger UI from the code when the code was itself already created by the schema?

  2. SwaggerResponseAttribute could easily get replaced by the ProducesResponseType as in MicrosoftDocs

  3. The SwaggerOperationAttribute only repeats the name of the method. Is it very necessary?

More about Swashbuckle in their repo:
https://github.com/domaindrivendev/Swashbuckle.AspNetCore

Swagger-codegen version

version 2.4.0

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the generated aspnetcore/.NET Core 2.0 server stub and its NuGet references, especially Swashbuckle.AspNetCore and Startup.Configure. Compare the required attributes and package versions, then verify the generated stub compiles after deciding whether to update or remove the dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.