swagger-api / swagger-api/swagger-codegen
[aspnetcore] update or remove Swashbuckle.AspNetCore nuget package
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?
-
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?
-
SwaggerResponseAttribute could easily get replaced by the ProducesResponseType as in MicrosoftDocs
-
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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