Skip to content

Commit

Permalink
fix: updates to latest OAI.net async changes
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed Jan 8, 2025
1 parent e2a6e20 commit f507645
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 8 additions & 2 deletions src/Kiota.Builder/KiotaBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,8 @@ private static string NormalizeApiManifestPath(RequestInfo request, string? base

// Should Generate
sw.Start();
shouldGenerate &= await workspaceManagementService.ShouldGenerateAsync(config, openApiDocument.HashCode, cancellationToken).ConfigureAwait(false);
var hashCode = await openApiDocument.GetHashCodeAsync(cancellationToken).ConfigureAwait(false);

Check failure on line 193 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 193 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 193 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 193 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 193 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / test-release (ubuntu-latest)

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 193 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / test-release (macos-latest)

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 193 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 193 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 193 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / test-release (windows-latest)

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)
shouldGenerate &= await workspaceManagementService.ShouldGenerateAsync(config, hashCode, cancellationToken).ConfigureAwait(false);
StopLogAndReset(sw, $"step {++stepId} - checking whether the output should be updated - took");

if (shouldGenerate && generating)
Expand Down Expand Up @@ -343,7 +344,12 @@ private async Task FinalizeWorkspaceAsync(Stopwatch sw, int stepId, OpenApiUrlTr
// Write lock file
sw.Start();
using var descriptionStream = !isDescriptionFromWorkspaceCopy ? await LoadStreamAsync(inputPath, cancellationToken).ConfigureAwait(false) : Stream.Null;
await workspaceManagementService.UpdateStateFromConfigurationAsync(config, openApiDocument?.HashCode ?? string.Empty, openApiTree?.GetRequestInfo().ToDictionary(static x => x.Key, static x => x.Value) ?? [], descriptionStream, cancellationToken).ConfigureAwait(false);
var hashCode = openApiDocument switch
{
null => string.Empty,
_ => await openApiDocument.GetHashCodeAsync(cancellationToken).ConfigureAwait(false),

Check failure on line 350 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 350 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 350 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 350 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 350 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / test-release (ubuntu-latest)

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 350 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / test-release (macos-latest)

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 350 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 350 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 350 in src/Kiota.Builder/KiotaBuilder.cs

View workflow job for this annotation

GitHub Actions / test-release (windows-latest)

'OpenApiDocument' does not contain a definition for 'GetHashCodeAsync' and no accessible extension method 'GetHashCodeAsync' accepting a first argument of type 'OpenApiDocument' could be found (are you missing a using directive or an assembly reference?)
};
await workspaceManagementService.UpdateStateFromConfigurationAsync(config, hashCode, openApiTree?.GetRequestInfo().ToDictionary(static x => x.Key, static x => x.Value) ?? [], descriptionStream, cancellationToken).ConfigureAwait(false);
StopLogAndReset(sw, $"step {++stepId} - writing lock file - took");
}
private readonly WorkspaceManagementService workspaceManagementService;
Expand Down
2 changes: 1 addition & 1 deletion src/Kiota.Builder/Plugins/PluginsGenerationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public async Task GenerateManifestAsync(CancellationToken cancellationToken = de
trimmedPluginDocument = GetDocumentWithTrimmedComponentsAndResponses(trimmedPluginDocument);
trimmedPluginDocument.Info.Title = trimmedPluginDocument.Info.Title[..^9]; // removing the second ` - Subset` suffix from the title
trimmedPluginDocument.SerializeAsV3(descriptionWriter);
descriptionWriter.Flush();
await descriptionWriter.FlushAsync(cancellationToken).ConfigureAwait(false);

Check failure on line 69 in src/Kiota.Builder/Plugins/PluginsGenerationService.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiYamlWriter' does not contain a definition for 'FlushAsync' and no accessible extension method 'FlushAsync' accepting a first argument of type 'OpenApiYamlWriter' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 69 in src/Kiota.Builder/Plugins/PluginsGenerationService.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiYamlWriter' does not contain a definition for 'FlushAsync' and no accessible extension method 'FlushAsync' accepting a first argument of type 'OpenApiYamlWriter' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 69 in src/Kiota.Builder/Plugins/PluginsGenerationService.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'OpenApiYamlWriter' does not contain a definition for 'FlushAsync' and no accessible extension method 'FlushAsync' accepting a first argument of type 'OpenApiYamlWriter' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 69 in src/Kiota.Builder/Plugins/PluginsGenerationService.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

'OpenApiYamlWriter' does not contain a definition for 'FlushAsync' and no accessible extension method 'FlushAsync' accepting a first argument of type 'OpenApiYamlWriter' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 69 in src/Kiota.Builder/Plugins/PluginsGenerationService.cs

View workflow job for this annotation

GitHub Actions / test-release (ubuntu-latest)

'OpenApiYamlWriter' does not contain a definition for 'FlushAsync' and no accessible extension method 'FlushAsync' accepting a first argument of type 'OpenApiYamlWriter' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 69 in src/Kiota.Builder/Plugins/PluginsGenerationService.cs

View workflow job for this annotation

GitHub Actions / test-release (macos-latest)

'OpenApiYamlWriter' does not contain a definition for 'FlushAsync' and no accessible extension method 'FlushAsync' accepting a first argument of type 'OpenApiYamlWriter' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 69 in src/Kiota.Builder/Plugins/PluginsGenerationService.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiYamlWriter' does not contain a definition for 'FlushAsync' and no accessible extension method 'FlushAsync' accepting a first argument of type 'OpenApiYamlWriter' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 69 in src/Kiota.Builder/Plugins/PluginsGenerationService.cs

View workflow job for this annotation

GitHub Actions / build

'OpenApiYamlWriter' does not contain a definition for 'FlushAsync' and no accessible extension method 'FlushAsync' accepting a first argument of type 'OpenApiYamlWriter' could be found (are you missing a using directive or an assembly reference?)

Check failure on line 69 in src/Kiota.Builder/Plugins/PluginsGenerationService.cs

View workflow job for this annotation

GitHub Actions / test-release (windows-latest)

'OpenApiYamlWriter' does not contain a definition for 'FlushAsync' and no accessible extension method 'FlushAsync' accepting a first argument of type 'OpenApiYamlWriter' could be found (are you missing a using directive or an assembly reference?)

// 3. write the plugins

Expand Down

0 comments on commit f507645

Please sign in to comment.