Skip to content

Commit

Permalink
feat: adds deconstructor to read result
Browse files Browse the repository at this point in the history
  • Loading branch information
baywet committed Dec 23, 2024
1 parent 7c9199b commit d8c1593
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Microsoft.OpenApi/Reader/ReadResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,13 @@ public class ReadResult
/// OpenApiDiagnostic contains the Errors reported while parsing
/// </summary>
public OpenApiDiagnostic Diagnostic { get; set; }
/// <summary>
/// Deconstructs the result for easier assignment on the client application.
/// </summary>
public void Deconstruct(out OpenApiDocument document, out OpenApiDiagnostic diagnostic)
{
document = Document;
diagnostic = Diagnostic;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,7 @@ namespace Microsoft.OpenApi.Reader
public ReadResult() { }
public Microsoft.OpenApi.Reader.OpenApiDiagnostic Diagnostic { get; set; }
public Microsoft.OpenApi.Models.OpenApiDocument Document { get; set; }
public void Deconstruct(out Microsoft.OpenApi.Models.OpenApiDocument document, out Microsoft.OpenApi.Reader.OpenApiDiagnostic diagnostic) { }
}
public enum ReferenceResolutionSetting
{
Expand Down

0 comments on commit d8c1593

Please sign in to comment.