diff --git a/CHANGELOG.md b/CHANGELOG.md index c766fd0c98..5d5b2b6b61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Aligns naming of sliced OpenAPI description generated by `plugin add` should be named `-openapi.json|yml` - Fixed RPC server to respect the `KIOTA_CONFIG_PREVIEW` flag. ## [1.14.0] - 2024-05-02 diff --git a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs index 92938a66b4..07a4a03ac5 100644 --- a/src/Kiota.Builder/Plugins/PluginsGenerationService.cs +++ b/src/Kiota.Builder/Plugins/PluginsGenerationService.cs @@ -36,11 +36,12 @@ public PluginsGenerationService(OpenApiDocument document, OpenApiUrlTreeNode ope } private static readonly OpenAPIRuntimeComparer _openAPIRuntimeComparer = new(); private const string ManifestFileNameSuffix = ".json"; - private const string DescriptionRelativePath = "openapi.yml"; + private const string DescriptionPathSuffix = "openapi.yml"; public async Task GenerateManifestAsync(CancellationToken cancellationToken = default) { // write the description - var descriptionFullPath = Path.Combine(Configuration.OutputPath, DescriptionRelativePath); + var descriptionRelativePath = $"{Configuration.ClientClassName.ToLowerInvariant()}-{DescriptionPathSuffix}"; + var descriptionFullPath = Path.Combine(Configuration.OutputPath, descriptionRelativePath); var directory = Path.GetDirectoryName(descriptionFullPath); if (!string.IsNullOrEmpty(directory) && !Directory.Exists(directory)) Directory.CreateDirectory(directory); @@ -64,7 +65,7 @@ public async Task GenerateManifestAsync(CancellationToken cancellationToken = de switch (pluginType) { case PluginType.Microsoft: - var pluginDocument = GetManifestDocument(DescriptionRelativePath); + var pluginDocument = GetManifestDocument(descriptionRelativePath); pluginDocument.Write(writer); break; case PluginType.APIManifest: diff --git a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs index c5d9ee93f1..d638375cce 100644 --- a/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs +++ b/tests/Kiota.Builder.Tests/Plugins/PluginsGenerationServiceTests.cs @@ -77,5 +77,5 @@ public async Task GeneratesManifest() Assert.Equal(OpenApiFileName, resultingManifest.Document.Runtimes.OfType().First().Spec.Url); } private const string ManifestFileName = "client-microsoft.json"; - private const string OpenApiFileName = "openapi.yml"; + private const string OpenApiFileName = "client-openapi.yml"; }