Skip to content

Commit d8c1593

Browse files
committed
feat: adds deconstructor to read result
1 parent 7c9199b commit d8c1593

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/Microsoft.OpenApi/Reader/ReadResult.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,13 @@ public class ReadResult
1818
/// OpenApiDiagnostic contains the Errors reported while parsing
1919
/// </summary>
2020
public OpenApiDiagnostic Diagnostic { get; set; }
21+
/// <summary>
22+
/// Deconstructs the result for easier assignment on the client application.
23+
/// </summary>
24+
public void Deconstruct(out OpenApiDocument document, out OpenApiDiagnostic diagnostic)
25+
{
26+
document = Document;
27+
diagnostic = Diagnostic;
28+
}
2129
}
2230
}

test/Microsoft.OpenApi.Tests/PublicApi/PublicApi.approved.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1380,6 +1380,7 @@ namespace Microsoft.OpenApi.Reader
13801380
public ReadResult() { }
13811381
public Microsoft.OpenApi.Reader.OpenApiDiagnostic Diagnostic { get; set; }
13821382
public Microsoft.OpenApi.Models.OpenApiDocument Document { get; set; }
1383+
public void Deconstruct(out Microsoft.OpenApi.Models.OpenApiDocument document, out Microsoft.OpenApi.Reader.OpenApiDiagnostic diagnostic) { }
13831384
}
13841385
public enum ReferenceResolutionSetting
13851386
{

0 commit comments

Comments
 (0)