Reputation: 41
I'd like to know how to rename generated swagger.json
when I add an OpenAPI service reference to my project in Visual studio 2019 via "Add new OpenAPI service reference" option.
I assume it should be something like it's done with a "ClassName".
<ItemGroup>
<OpenApiReference Include="OpenAPIs\swagger.json" CodeGenerator="NSwagCSharp" Namespace="PetStore.Client">
<SourceUri>https://petstore.swagger.io/v2/swagger.json</SourceUri>
<ClassName>PetStoreClient</ClassName>
<OutputPath>PetStoreClient.cs</OutputPath>
<Options>/GenerateClientInterfaces:true /ClientBaseClass:ClientBase</Options>
</OpenApiReference>
</ItemGroup>
Upvotes: 3
Views: 1668
Reputation: 4662
To change this just change the Include
parameter of <OpenApiReference />
to another path. Then refresh the service reference.
This might require cleaning the solution manually (for some reason OpenApi related things in bin
and obj
don't clean themselves sometimes).
Upvotes: 1