Closed jeevasusej closed 4 years ago
What .net core version are you using? Are you using the latest/same version in CLI and the nuget package?
I am using netcoreapp3.1. NSwag.MsBuild 13.6.2 NSwag.AspnetCore 13.6.2.
<Target Name="NSwag" AfterTargets="Build" Condition="'$(Configuration)' == 'Debug'">
<Copy SourceFiles="@(Reference)" DestinationFolder="$(OutDir)References" />
<Exec Command="$(NSwagExe_Core31) run /variables:Configuration=$(Configuration)" />
<RemoveDir Directories="$(OutDir)References" />
</Target>
Move the following code out of the env.developement then it worked.
services.AddOpenApiDocument(configure =>
{
configure.Title = " API";
configure.AddSecurity("JWT", Enumerable.Empty<string>(), new OpenApiSecurityScheme
{
Type = OpenApiSecuritySchemeType.ApiKey,
Name = "Authorization",
In = OpenApiSecurityApiKeyLocation.Header,
Description = "Type into the textbox: Bearer {your JWT token}."
});
configure.OperationProcessors.Add(new AspNetCoreOperationSecurityScopeProcessor("JWT"));
});
Issue that I am getting:
Configuration:
Code: