Skip to content

Commit

Permalink
Fix #38
Browse files Browse the repository at this point in the history
  • Loading branch information
unchase committed Feb 16, 2021
1 parent ab4ff67 commit e7823a5
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

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).

## v1.5.14 `(2021-02-16)`
## v1.5.15 `(2021-02-16)`

- [x] Fix [issue #38](https://github.com/unchase/Unchase.OpenAPI.Connectedservice/issues/38)

Expand Down
2 changes: 2 additions & 0 deletions src/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public static class Constants
public const string PortableDataAnnotationsNuGetPackage = "Portable.DataAnnotations";
public const string MicrosoftAspNetCoreMvcNuGetPackage = "Microsoft.AspNetCore.Mvc";

public const string OpenApiConvertSettingsPathPrefix = "OData";

public static string[] NetStandartNuGetPackages = {
NewtonsoftJsonNuGetPackage,
SystemNetHttpNuGetPackage,
Expand Down
4 changes: 2 additions & 2 deletions src/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.2.*")]
[assembly: AssemblyVersion("1.5.14")]
[assembly: AssemblyFileVersion("1.5.14.0")]
[assembly: AssemblyVersion("1.5.15")]
[assembly: AssemblyFileVersion("1.5.15.0")]
[assembly: NeutralResourcesLanguage("en-US")]

8 changes: 0 additions & 8 deletions src/ViewModels/ConfigOpenApiEndpointViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ public ConfigOpenApiEndpointViewModel(UserSettings userSettings, Wizard wizard)
this.UseNetworkCredentials = false;
this.UseWebProxy = false;
this.UseWebProxyCredentials = false;
if (string.IsNullOrWhiteSpace(this.UserSettings.OpenApiConvertSettings?.PathPrefix))
{
this.UserSettings.OpenApiConvertSettings.PathPrefix = "OData";
}
}

#endregion
Expand All @@ -124,10 +120,6 @@ public override async Task<PageNavigationResult> OnPageLeavingAsync(WizardLeavin
{
this.UserSettings.OpenApiConvertSettings.ServiceRoot = new Uri(this.UserSettings.Endpoint.TrimEnd("$metadata".ToCharArray()));
}
if (string.IsNullOrWhiteSpace(this.UserSettings.OpenApiConvertSettings.PathPrefix))
{
this.UserSettings.OpenApiConvertSettings.PathPrefix = "OData";
}
var document = model.ConvertToOpenApi(this.UserSettings.OpenApiConvertSettings);
var outputJson = document.SerializeAsJson(this.UserSettings.OpenApiSpecVersion);
File.WriteAllText(this.SpecificationTempPath, outputJson);
Expand Down
5 changes: 5 additions & 0 deletions src/Wizard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,11 @@ private ServiceConfiguration CreateServiceConfiguration()
if (serviceConfiguration.GenerateCSharpController && CSharpControllerSettingsViewModel.Command != null)
serviceConfiguration.OpenApiToCSharpControllerCommand = CSharpControllerSettingsViewModel.Command;

if (string.IsNullOrWhiteSpace(serviceConfiguration.OpenApiConvertSettings?.PathPrefix))
{
serviceConfiguration.OpenApiConvertSettings.PathPrefix = Constants.OpenApiConvertSettingsPathPrefix;
}

return serviceConfiguration;
}

Expand Down
2 changes: 1 addition & 1 deletion src/source.extension.vsixmanifest
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
<Metadata>
<Identity Id="Unchase.Openapi.ConnectedService.63199638-6211-4285-ba8f-75b1f0326c2a" Version="1.5.14" Language="en-US" Publisher="Unchase" />
<Identity Id="Unchase.Openapi.ConnectedService.63199638-6211-4285-ba8f-75b1f0326c2a" Version="1.5.15" Language="en-US" Publisher="Unchase" />
<DisplayName>Unchase OpenAPI (Swagger) Connected Service</DisplayName>
<Description xml:space="preserve">Connected service for Visual Studio to generate OpenAPI (Swagger) web service reference.</Description>
<MoreInfo>https://github.com/unchase/Unchase.OpenAPI.Connectedservice</MoreInfo>
Expand Down

0 comments on commit e7823a5

Please sign in to comment.