Skip to content

Commit 65014b1

Browse files
authored
Fix typo NSwag (#5918)
* Fix typo NSwag Replace NSawg by NSwag. * Fix other occurrences
1 parent 20090d3 commit 65014b1

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

msbuild/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This folder includes MSBuild examples:
66

77
[Please see the Custom Task-Code Generation Readme](./custom-task-code-generation/)
88

9-
1. Generate a Rest Client API during the build process. The example uses [NSawg](https://docs.microsoft.com/aspnet/core/tutorials/getting-started-with-nswag) as a client generator (It is also a code generation example). It is a very common scenario. We are going to create two examples
9+
1. Generate a Rest Client API during the build process. The example uses [NSwag](https://docs.microsoft.com/aspnet/core/tutorials/getting-started-with-nswag) as a client generator (It is also a code generation example). It is a very common scenario. We are going to create two examples
1010

1111
1. Use the pre-defined [MSBuild Exec Task](https://docs.microsoft.com/en-us/dotnet/api/microsoft.build.tasks.exec) to do that.
1212
1. Use the _MSBuild Custom Task_ derived from [MSBuild Tool Task](https://docs.microsoft.com/dotnet/api/microsoft.build.utilities.tooltask) to do that.

msbuild/rest-api-client-generation/PetReaderToolTaskExample/PetReaderToolTaskExample/PetRestApiClient/PetRestApiClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PetClientClientClassName>PetRestApiClient</PetClientClientClassName>
1111
<PetClientClientNamespaceName>PetRestApiClient</PetClientClientNamespaceName>
1212
<PetClientFolderClientClass>PetRestApiClient</PetClientFolderClientClass>
13-
<!--The directory where NSawg.exe is in-->
13+
<!--The directory where NSwag.exe is in-->
1414
<NSwagCommandFullPath>C:\Nwag\Win</NSwagCommandFullPath>
1515
</PropertyGroup>
1616

msbuild/rest-api-client-generation/PetReaderToolTaskExample/PetReaderToolTaskExample/RestApiClientGenerator.Test/Resources/testscript-fail.msbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PetClientClientClassName>PetRestApiClientFail</PetClientClientClassName>
1111
<PetClientClientNamespaceName>PetRestApiClientFail</PetClientClientNamespaceName>
1212
<PetClientFolderClientClass>..</PetClientFolderClientClass>
13-
<!--The directory where NSawg.exe is in-->
13+
<!--The directory where NSwag.exe is in-->
1414
<NSwagCommandFullPath>C:\Nwag\Win</NSwagCommandFullPath>
1515
</PropertyGroup>
1616

msbuild/rest-api-client-generation/PetReaderToolTaskExample/PetReaderToolTaskExample/RestApiClientGenerator.Test/Resources/testscript-success.msbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PetClientClientClassName>PetRestApiClientSuccess</PetClientClientClassName>
1111
<PetClientClientNamespaceName>PetRestApiClientSuccess</PetClientClientNamespaceName>
1212
<PetClientFolderClientClass>..</PetClientFolderClientClass>
13-
<!--The directory where NSawg.exe is in-->
13+
<!--The directory where NSwag.exe is in-->
1414
<NSwagCommandFullPath>C:\Nwag\Win</NSwagCommandFullPath>
1515
</PropertyGroup>
1616

msbuild/rest-api-client-generation/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Rest Api Client Generation
22

3-
Nowadays, an application which consumes RestApi is a very common scenario. We are going to generate the Rest API client automatically during the build process. We will use [NSawg](https://docs.microsoft.com/aspnet/core/tutorials/getting-started-with-nswag?view=aspnetcore-6.0&tabs=visual-studio)
3+
Nowadays, an application which consumes RestApi is a very common scenario. We are going to generate the Rest API client automatically during the build process. We will use [NSwag](https://docs.microsoft.com/aspnet/core/tutorials/getting-started-with-nswag?view=aspnetcore-6.0&tabs=visual-studio)
44

55
Our app will be a console app, because it is simpler. The kind of app which use the Rest Api client is not important.
66
The example will consume the public [Pet Store API](https://petstore.swagger.io), which publish the [OpenAPI spec](https://petstore.swagger.io/v2/swagger.json)
@@ -52,7 +52,7 @@ The complete code version is in this PetReaderExecTaskExample folder, you can do
5252

5353
You can notice we are using [BeforeTarget and AfterTarget](https://docs.microsoft.com/visualstudio/msbuild/target-build-order#beforetargets-and-aftertargets) as way to define build order.
5454
The first target called "generatePetClient" will be executed before the core compilation target, so we will create the source before the compiler executes. The input and output parameter are related to [Incremental Build](https://docs.microsoft.com/visualstudio/msbuild/how-to-build-incrementally). MSBuild can compare the timestamps of the input files with the timestamps of the output files and determine whether to skip, build, or partially rebuild a target.
55-
After installing the NSwag.MSBuild NuGet package in your project, you can use the variable $(NSwagExe) in your .csproj file to run the NSwag command line tool in an MSBuild target. This way the tools can easily be updated via NuGet. Here we are using the _Exec MSBUild Task_ to execute the NSwag program with the required parameters to generate the client Rest Api. [More about Nsawg command and parameters](https://github.com/RicoSuter/NSwag/wiki/NSwag.MSBuild).
55+
After installing the NSwag.MSBuild NuGet package in your project, you can use the variable $(NSwagExe) in your .csproj file to run the NSwag command line tool in an MSBuild target. This way the tools can easily be updated via NuGet. Here we are using the _Exec MSBUild Task_ to execute the NSwag program with the required parameters to generate the client Rest Api. [More about NSwag command and parameters](https://github.com/RicoSuter/NSwag/wiki/NSwag.MSBuild).
5656
You can capture output from `<Exec>` addig ConsoleToMsBuild="true" to your `<Exec>` tag and then capture the output using the ConsoleOutput parameter in an `<Output>` tag. ConsoleOutput returns the output as an Item. Whitespace is trimmed. ConsoleOutput is enabled when ConsoleToMSBuild is true.
5757
The second target called "forceReGenerationOnRebuild" deletes the generated class during clean up to force the regeneration on rebuild target execution. This target runs after core clean MSBuild pre defined target.
5858

@@ -232,8 +232,8 @@ The complete code version is in this PetReaderToolTaskExample folder, you can do
232232
<PetClientClientClassName>PetRestApiClient</PetClientClientClassName>
233233
<PetClientClientNamespaceName>PetRestApiClient</PetClientClientNamespaceName>
234234
<PetClientFolderClientClass>PetRestApiClient</PetClientFolderClientClass>
235-
<!--The directory where NSawg.exe is in-->
236-
<NSwagCommandFullPath>C:\Nsawg\Win</NSwagCommandFullPath>
235+
<!--The directory where NSwag.exe is in-->
236+
<NSwagCommandFullPath>C:\NSwag\Win</NSwagCommandFullPath>
237237
</PropertyGroup>
238238
```
239239

0 commit comments

Comments
 (0)