Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="$(MicrosoftExtensionsLoggingConsoleVersion)" />
<PackageVersion Include="Microsoft.FileFormats" Version="$(MicrosoftFileFormatsVersion)" />
<PackageVersion Include="Microsoft.Identity.Web" Version="$(MicrosoftIdentityWebVersion)" />
<PackageVersion Include="Microsoft.OpenApi.Readers" Version="$(MicrosoftOpenApiReadersVersion)" />
<PackageVersion Include="Microsoft.OpenApi" Version="$(MicrosoftOpenApiVersion)" />
<PackageVersion Include="Moq" Version="$(MoqVersion)" />
<PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageVersion Include="NJsonSchema" Version="$(NJsonSchemaVersion)" />
Expand Down
21 changes: 9 additions & 12 deletions documentation/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -2079,14 +2079,13 @@
"nullable": true
},
"error": {
"type": "object",
"oneOf": [
{
"nullable": true
},
{
"$ref": "#/components/schemas/OperationError"
}
]
],
"nullable": true
},
"operationId": {
"type": "string",
Expand All @@ -2100,14 +2099,13 @@
"$ref": "#/components/schemas/OperationState"
},
"process": {
"type": "object",
"oneOf": [
{
"nullable": true
},
{
"$ref": "#/components/schemas/OperationProcessInfo"
}
]
],
"nullable": true
},
"egressProviderName": {
"type": "string",
Expand Down Expand Up @@ -2143,14 +2141,13 @@
"$ref": "#/components/schemas/OperationState"
},
"process": {
"type": "object",
"oneOf": [
{
"nullable": true
},
{
"$ref": "#/components/schemas/OperationProcessInfo"
}
]
],
"nullable": true
},
"egressProviderName": {
"type": "string",
Expand Down
2 changes: 1 addition & 1 deletion eng/dependabot/independent/Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PackageReference Include="Azure.Storage.Blobs" Version="$(AzureStorageBlobsVersion)" />
<PackageReference Include="Azure.Storage.Queues" Version="$(AzureStorageQueuesVersion)" />
<PackageReference Include="System.Private.Uri" Version="$(SystemPrivateUriVersion)" />
<PackageReference Include="Microsoft.OpenApi.Readers" Version="$(MicrosoftOpenApiReadersVersion)" />
<PackageReference Include="Microsoft.OpenApi" Version="$(MicrosoftOpenApiVersion)" />
<PackageReference Include="Microsoft.Identity.Web" Version="$(MicrosoftIdentityWebVersion)" />

<!-- Third-party references -->
Expand Down
2 changes: 1 addition & 1 deletion eng/dependabot/independent/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<AzureStorageBlobsVersion>12.29.1</AzureStorageBlobsVersion>
<AzureStorageQueuesVersion>12.27.1</AzureStorageQueuesVersion>
<MicrosoftIdentityWebVersion>4.10.0</MicrosoftIdentityWebVersion>
<MicrosoftOpenApiReadersVersion>1.6.29</MicrosoftOpenApiReadersVersion>
<MicrosoftOpenApiVersion>2.7.5</MicrosoftOpenApiVersion>
<SystemPrivateUriVersion>4.3.2</SystemPrivateUriVersion>
<SystemSecurityPrincipalWindowsVersion>5.0.0</SystemSecurityPrincipalWindowsVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.OpenApi.Readers" />
<PackageReference Include="Microsoft.OpenApi" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@

using Microsoft.Diagnostics.Monitoring.TestCommon;
using Microsoft.Diagnostics.Monitoring.TestCommon.Runners;
using Microsoft.OpenApi.Extensions;
using Microsoft.OpenApi.Models;
using Microsoft.OpenApi.Readers;
using Microsoft.OpenApi.Validations;
using Microsoft.OpenApi;
using Microsoft.OpenApi.Reader;
using System;
using System.Collections.Generic;
using System.IO;
Expand Down Expand Up @@ -80,11 +78,11 @@ public async Task BaselineDifferenceTestAsync()
/// Test that the committed OpenAPI document is valid.
/// </summary>
[Fact]
public void BaselineIsValidTest()
public async Task BaselineIsValidTestAsync()
{
using FileStream stream = new(OpenApiBaselinePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);

ValidateDocument(stream);
await ValidateDocumentAsync(stream);
}

/// <summary>
Expand All @@ -95,7 +93,7 @@ public async Task GeneratedIsValidTestAsync()
{
using FileStream stream = await GenerateDocumentAsync();

ValidateDocument(stream);
await ValidateDocumentAsync(stream);
}

private async Task<FileStream> GenerateDocumentAsync()
Expand All @@ -119,13 +117,12 @@ private async Task<FileStream> GenerateDocumentAsync()
return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, 4096, FileOptions.DeleteOnClose);
}

private static void ValidateDocument(FileStream stream)
private static async Task ValidateDocumentAsync(Stream stream)
{
OpenApiStreamReader reader = new();
OpenApiDocument document = reader.Read(stream, out OpenApiDiagnostic diagnostic);
Assert.Empty(diagnostic.Errors);
ReadResult result = await OpenApiDocument.LoadAsync(stream, OpenApiConstants.Json);
Assert.Empty(result.Diagnostic.Errors);

IEnumerable<OpenApiError> errors = document.Validate(ValidationRuleSet.GetDefaultRuleSet());
IEnumerable<OpenApiError> errors = result.Document.Validate(ValidationRuleSet.GetDefaultRuleSet());
Assert.Empty(errors);
}
}
Expand Down