CopyPastor

Detecting plagiarism made easy.

Score: 0.800356388092041; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2025-06-04
by ctekse

Original Post

Original - Posted on 2025-06-04
by ctekse



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Partially based on Hakan Fıstık [answer](https://stackoverflow.com/a/79230153/261604) and on Martin Capodici's comment on the question, here is my solution:
*Swashbuckle.AspNetCore* has reference to *Microsoft.Extensions.ApiDescription.Server* so all you have to do is to add these lines to the `.csproj` file's `PropertyGroup` block:
``` <OpenApiDocumentsDirectory>$(MSBuildProjectDirectory)\OUTPUT_FOLDER</OpenApiDocumentsDirectory> <OpenApiGenerateDocuments>true</OpenApiGenerateDocuments> <OpenApiGenerateDocumentsOnBuild>true</OpenApiGenerateDocumentsOnBuild> ```
This will generate the swagger json file in the `OUTPUT_FOLDER` with this name: `$(MSBuildProjectName).json`
More details: <https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/overview?view=aspnetcore-9.0#microsoftextensionsapidescriptionserver-nuget-package>
I'm using *Swashbuckle.AspNetCore v6.6.2* and this is my solution:
*Swashbuckle.AspNetCore* has reference to *Microsoft.Extensions.ApiDescription.Server* so all you have to do is to add these lines to the `.csproj` file's `PropertyGroup` block:
``` <OpenApiDocumentsDirectory>$(MSBuildProjectDirectory)\OUTPUT_FOLDER</OpenApiDocumentsDirectory> <OpenApiGenerateDocuments>true</OpenApiGenerateDocuments> <OpenApiGenerateDocumentsOnBuild>true</OpenApiGenerateDocumentsOnBuild> ```
This will generate the swagger json file in the `OUTPUT_FOLDER` with this name: `$(MSBuildProjectName).json`
More details: <https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/overview?view=aspnetcore-9.0#microsoftextensionsapidescriptionserver-nuget-package>

        
Present in both answers; Present only in the new answer; Present only in the old answer;