Skip to content

Commit

Permalink
Renames plugin to API plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Omondi committed Jun 4, 2024
1 parent ad2b8e0 commit 1ebf913
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@
"--type",
"ApiManifest",
"--type",
"microsoft",
"ApiPlugin",
"--type",
"OpenAI"
],
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix scalar member composed type serialization in PHP [#2827](https://github.com/microsoft/kiota/issues/2827)
- Trims unused components from output openApi document when generating plugins [#4672](https://github.com/microsoft/kiota/issues/4672)
- Fixes missing imports for UntypedNode when backingstore is enabled in Java.
- Renames `name_to_be_defined` plugin type to `apiplugin` [#4713](https://github.com/microsoft/kiota/issues/4713)

## [1.14.0] - 2024-05-02

Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/PluginType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ public enum PluginType
{
OpenAI,
APIManifest,
Microsoft
APIPlugin
}
5 changes: 3 additions & 2 deletions src/Kiota.Builder/Plugins/PluginsGenerationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public async Task GenerateManifestAsync(CancellationToken cancellationToken = de

switch (pluginType)
{
case PluginType.Microsoft:
case PluginType.APIPlugin:
var pluginDocument = GetManifestDocument(descriptionRelativePath);
pluginDocument.Write(writer);
break;
Expand Down Expand Up @@ -173,7 +173,8 @@ private PluginManifestDocument GetManifestDocument(string openApiDocumentPath)
var manifestInfo = ExtractInfoFromDocument(OAIDocument.Info);
return new PluginManifestDocument
{
SchemaVersion = "v2",
Schema = "https://aka.ms/json-schemas/copilot-extensions/v2.1/plugin.schema.json",
SchemaVersion = "v2.1",
NameForHuman = OAIDocument.Info?.Title.CleanupXMLString(),
// TODO name for model ???

Check warning on line 179 in src/Kiota.Builder/Plugins/PluginsGenerationService.cs

View workflow job for this annotation

GitHub Actions / Build

Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)

Check warning on line 179 in src/Kiota.Builder/Plugins/PluginsGenerationService.cs

View workflow job for this annotation

GitHub Actions / Build

Complete the task associated to this 'TODO' comment. (https://rules.sonarsource.com/csharp/RSPEC-1135)
DescriptionForHuman = descriptionForHuman,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public async Task GeneratesManifest()
{
OutputPath = outputDirectory,
OpenAPIFilePath = "openapiPath",
PluginTypes = [PluginType.Microsoft, PluginType.APIManifest, PluginType.OpenAI],
PluginTypes = [PluginType.APIPlugin, PluginType.APIManifest, PluginType.OpenAI],
ClientClassName = "client",
ApiRootUrl = "http://localhost/", //Kiota builder would set this for us
};
Expand Down Expand Up @@ -108,7 +108,7 @@ public async Task GeneratesManifest()
Assert.Equal(OpenApiFileName, v1Manifest.Document.Api.URL);
Assert.Empty(v1Manifest.Problems);
}
private const string ManifestFileName = "client-microsoft.json";
private const string ManifestFileName = "client-apiplugin.json";
private const string OpenAIPluginFileName = "openai-plugins.json";
private const string OpenApiFileName = "client-openapi.yml";

Expand Down Expand Up @@ -171,7 +171,7 @@ public async Task GeneratesManifestAndCleansUpInputDescription()
{
OutputPath = outputDirectory,
OpenAPIFilePath = "openapiPath",
PluginTypes = [PluginType.Microsoft],
PluginTypes = [PluginType.APIPlugin],
ClientClassName = "client",
ApiRootUrl = "http://localhost/", //Kiota builder would set this for us
};
Expand Down

0 comments on commit 1ebf913

Please sign in to comment.