@@ -134,14 +134,8 @@ private static async Task<ApiDependency> FindApiDependency(string apiManifestPat
134
134
{
135
135
apiManifest = ApiManifestDocument . Load ( JsonDocument . Parse ( fileStream ) . RootElement ) ;
136
136
}
137
- if ( apiDependencyName != null )
138
- {
139
- apiDependency = apiManifest . ApiDependencies [ apiDependencyName ] ;
140
- }
141
- else
142
- {
143
- apiDependency = apiManifest . ApiDependencies . First ( ) . Value ;
144
- }
137
+
138
+ apiDependency = apiDependencyName != null ? apiManifest . ApiDependencies [ apiDependencyName ] : apiManifest . ApiDependencies . First ( ) . Value ;
145
139
}
146
140
147
141
return apiDependency ;
@@ -284,9 +278,8 @@ private static async Task<OpenApiDocument> GetOpenApi(string openapi, string csd
284
278
private static Dictionary < string , List < string > > GetRequestUrlsFromManifest ( ApiDependency apiDependency , OpenApiDocument document )
285
279
{
286
280
// Get the request URLs from the API Dependencies in the API manifest that have a baseURL that matches the server URL in the OpenAPI document
287
- var serversUrls = document . Servers . Select ( s => s . Url ) ;
288
281
var requests = apiDependency
289
- . Requests . Where ( r => r . Exclude == false )
282
+ . Requests . Where ( r => ! r . Exclude )
290
283
. Select ( r=> new { UriTemplate = r . UriTemplate , Method = r . Method } )
291
284
. GroupBy ( r => r . UriTemplate )
292
285
. ToDictionary ( g => g . Key , g => g . Select ( r => r . Method ) . ToList ( ) ) ;
@@ -745,7 +738,7 @@ internal async static Task PluginManifest(HidiOptions options, ILogger<OpenApiSe
745
738
// Write OpenAIPluginManifest to Output folder
746
739
var manifestFile = new FileInfo ( Path . Combine ( options . OutputFolder , "ai-plugin.json" ) ) ;
747
740
using var file = new FileStream ( manifestFile . FullName , FileMode . Create ) ;
748
- var jsonWriter = new Utf8JsonWriter ( file , new JsonWriterOptions { Indented = true } ) ;
741
+ using var jsonWriter = new Utf8JsonWriter ( file , new JsonWriterOptions { Indented = true } ) ;
749
742
manifest . Write ( jsonWriter ) ;
750
743
jsonWriter . Flush ( ) ;
751
744
}
0 commit comments