diff --git a/CHANGELOG.md b/CHANGELOG.md index 740485f..62537b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/src/Constants.cs b/src/Constants.cs index 3663a0e..0ed89f2 100644 --- a/src/Constants.cs +++ b/src/Constants.cs @@ -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, diff --git a/src/Properties/AssemblyInfo.cs b/src/Properties/AssemblyInfo.cs index c343326..145e76a 100644 --- a/src/Properties/AssemblyInfo.cs +++ b/src/Properties/AssemblyInfo.cs @@ -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")] diff --git a/src/ViewModels/ConfigOpenApiEndpointViewModel.cs b/src/ViewModels/ConfigOpenApiEndpointViewModel.cs index 4c73e74..ccb2d5e 100644 --- a/src/ViewModels/ConfigOpenApiEndpointViewModel.cs +++ b/src/ViewModels/ConfigOpenApiEndpointViewModel.cs @@ -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 @@ -124,10 +120,6 @@ public override async Task 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); diff --git a/src/Wizard.cs b/src/Wizard.cs index 3c47eae..6f1cd8e 100644 --- a/src/Wizard.cs +++ b/src/Wizard.cs @@ -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; } diff --git a/src/source.extension.vsixmanifest b/src/source.extension.vsixmanifest index 38c7ffb..48b2b68 100644 --- a/src/source.extension.vsixmanifest +++ b/src/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + Unchase OpenAPI (Swagger) Connected Service Connected service for Visual Studio to generate OpenAPI (Swagger) web service reference. https://github.com/unchase/Unchase.OpenAPI.Connectedservice