Skip to content

Commit

Permalink
Aligns plugin naming
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Omondi committed May 3, 2024
1 parent 41fc378 commit d711fea
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ 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 `<plugin-name>-openapi.json|yml`

## [1.14.0] - 2024-05-02

### Added
Expand Down
7 changes: 4 additions & 3 deletions src/Kiota.Builder/Plugins/PluginsGenerationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ public async Task GeneratesManifest()
Assert.Equal(OpenApiFileName, resultingManifest.Document.Runtimes.OfType<OpenApiRuntime>().First().Spec.Url);
}
private const string ManifestFileName = "client-microsoft.json";
private const string OpenApiFileName = "openapi.yml";
private const string OpenApiFileName = "client-openapi.yml";
}

0 comments on commit d711fea

Please sign in to comment.