Skip to content

Commit 84f7e4c

Browse files
committed
1) Added "Compare OpenAPI-specifications... Сommand" section to README.md;
2) Added menu command embedded in Visual Studio Solution Explorer context menu lets you compare generated ".nswag.json" specification-file with another ".nswag.json" specification-file (or with specification given by "endpoint"); 3) Fixed bug with empty "ServiceName"; 4) Small fixes.
1 parent 52672de commit 84f7e4c

28 files changed

+593
-245
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
These are the changes to each version that has been released on the official [Visual Studio extension gallery](https://marketplace.visualstudio.com/items?itemName=unchase.UnchaseOpenAPIConnectedService).
99

10+
## v1.2.0 `(2019-04-20)`
11+
12+
- [x] Added `Compare OpenAPI-specifications... Command` section to [`README`](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/)
13+
- [x] Added menu command embedded in Visual Studio Solution Explorer context menu lets you compare generated `.nswag.json` specification-file with another `.nswag.json` specification-file (or with specification given by `endpoint`)
14+
- [x] Fixed bug with empty `ServiceName`
15+
- [x] Small fixes
16+
1017
## v1.1.15 `(2019-04-20)`
1118

1219
- [x] Added fix: service now visible in `VisualBasic` projects
@@ -50,7 +57,7 @@ These are the changes to each version that has been released on the official [Vi
5057

5158
## v1.1.0 `(2019-04-10)`
5259

53-
- [x] Add `Open in NSwagStudio Command` section to [`README`](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/)
60+
- [x] Added `Open in NSwagStudio Command` section to [`README`](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/)
5461
- [x] Added menu command embedded in Visual Studio Solution Explorer context menu lets you open generated `.nswag` and `.nswag.json` files in [NSWagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio)
5562

5663
## v1.0.6 `(2019-04-08)`

README.md

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
3. Portable.DataAnnotations ([NuGet](https://www.nuget.org/packages/Portable.DataAnnotations))
3838
- Add Required dependences for the `C#` controller (before generating):
3939
1. Microsoft.AspNetCore.Mvc ([NuGet](https://www.nuget.org/packages/Microsoft.AspNetCore.MVC))
40+
- **Command** to open generated `.nswag` and `.nswag.json` files in [NSWagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio)
41+
- **Command** to compare `.nswag.json` specification file with another `.nswag.json` specification file (or specification given by `endpoint`)
4042
- Storage of the last 10 endpoints (json-specification path)
4143

4244
## Getting Started
@@ -51,29 +53,59 @@ Meaning of the Unchase [OpenAPI (Swagger) Connected Service](https://marketplace
5153

5254
![Unchase OpenAPI (Swagger) Connected Service settings meaning](img/Unchase-OpenAPI-Swagger-Connected-Service-Settings-Meaning.png)
5355

54-
## Open in NSwagStudio Command
56+
## Custom Commands
5557

56-
Since *v1.1.** was added menu command embedded in Visual Studio Solution Explorer context menu lets you open generated `.nswag` and `.nswag.json` files in [NSWagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio).
58+
### `Open in NSwagStudio` Command
59+
60+
Since *v1.1.** have been added menu command embedded in Visual Studio Solution Explorer context menu lets you open generated `.nswag` and `.nswag.json` files in [NSWagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio).
5761

5862
This extension is for those times where you generate `.nswag` and `.nswag.json` files and you want to be able to quickly open it in [NSWagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio).
5963

60-
### Prerequisite
64+
#### Prerequisite
6165

6266
> In order to use this extension, you must have [Visual Studio](https://visualstudio.microsoft.com/vs/) 2017/2019, this connected service as well as [NSWagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio) installed.
6367
64-
### Solution Explorer
68+
#### Solution Explorer
6569

66-
You can open `.nswag` and `.nswag.json` files in NSwagStudio by simply right-clicking it in Solution Explorer and select **Open in NSwagStudio**:
70+
You can open `.nswag` and `.nswag.json` files in [NSWagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio) by simply right-clicking it in Solution Explorer and select **Open in NSwagStudio**:
6771

68-
![Open in NSwagStudio menu command](img/OpenWithNSwagCommandMenu.png)
72+
![Open in NSwagStudio menu Command](img/OpenWithNSwagCommandMenu.png)
6973

70-
### Path to NSwagStudio.exe
74+
#### Path to NSwagStudio.exe
7175

7276
If you installed [NSWagStudio](https://github.com/NSwag/NSwag/wiki/NSwagStudio) at a non-default location, a prompt will ask for the path to `NSwagStudio.exe`.
7377

7478
You can always change the location in *Tools -> Options -> Web -> Unchase OpenAPI (Swagger) Connected Service*:
7579

76-
![Open in NSwagStudio Option](img/OpenWithNSwagCommandOptions.png)
80+
![Open in NSwagStudio Option](img/UnchaseOpenAPIConnectedServiceCommandsOptions1.png)
81+
82+
### `Compare OpenAPI-specifications...` Command
83+
84+
Since *v1.2.** have been added menu command embedded in Visual Studio Solution Explorer context menu lets you compare generated `.nswag.json` specification-file with another `.nswag.json` specification-file (or with specification given by `endpoint`).
85+
86+
This extension is for those times where you generate `.nswag.json` file and you want to quickly compare it with another or specification given by `endpoint`.
87+
88+
#### Prerequisite
89+
90+
> In order to use this extension, you must have [Visual Studio](https://visualstudio.microsoft.com/vs/) 2017/2019 as well as this connected service.
91+
92+
#### Solution Explorer
93+
94+
You can compare `.nswag.json` specification-file with another `.nswag.json` specification-file (or with specification given by `endpoint`) by simply selecting one or two files and right-clicking them in Solution Explorer and select **Compare OpenAPI-specifications...**:
95+
96+
![Compare OpenAPI Specifications Command](img/CompareOpenAPISpecificationsOneFileCommandMenu.png)
97+
98+
![Compare OpenAPI Specifications Command](img/CompareOpenAPISpecificationsTwoFilesCommandMenu.png)
99+
100+
#### Path to the specification `Endpoint`
101+
102+
You can always change the specification Endpoint to compare with in *Tools -> Options -> Web -> Unchase OpenAPI (Swagger) Connected Service*:
103+
104+
![Compare OpenAPI Specifications Option](img/UnchaseOpenAPIConnectedServiceCommandsOptions2.png)
105+
106+
#### Compare View
107+
108+
![Compare OpenAPI Specifications Command result](img/CompareOpenAPISpecificationsCommandResult.png)
77109

78110
## HowTos
79111

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: 1.1.{build}
1+
version: 1.2.{build}
22
pull_requests:
33
do_not_increment_build_number: true
44
skip_tags: true
66.6 KB
Loading
4.46 KB
Loading
6.05 KB
Loading
-18.4 KB
Binary file not shown.
25.4 KB
Loading
26 KB
Loading

src/CodeGeneration/NSwagCodeGenDescriptor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ internal async Task<string> GenerateNswagFileAsync(ConnectedServiceHandlerContex
196196
{
197197
var nameSpace = context.ProjectHierarchy.GetProject().GetNameSpace();
198198
var serviceUrl = instance.ServiceConfig.Endpoint;
199+
if (string.IsNullOrWhiteSpace(instance.Name))
200+
instance.Name = Constants.DefaultServiceName;
199201
var rootFolder = context.HandlerHelper.GetServiceArtifactsRootFolder();
200202
var serviceFolder = instance.Name;
201203
var document = NSwagDocument.Create();

0 commit comments

Comments
 (0)