Skip to content

Commit 0636e4a

Browse files
committed
Add a hashCode field to the diagnostics object to keep track of the hash value
1 parent 853e351 commit 0636e4a

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/Microsoft.OpenApi.Readers/OpenApiDiagnostic.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,10 @@ public class OpenApiDiagnostic : IDiagnostic
2626
/// Open API specification version of the document parsed.
2727
/// </summary>
2828
public OpenApiSpecVersion SpecificationVersion { get; set; }
29+
30+
/// <summary>
31+
/// The unique hash code of the generated OpenAPI document
32+
/// </summary>
33+
public int HashCode { get; set; }
2934
}
3035
}

src/Microsoft.OpenApi.Readers/ParsingContext.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ internal OpenApiDocument Parse(YamlDocument yamlDocument)
7575
throw new OpenApiUnsupportedSpecVersionException(inputVersion);
7676
}
7777

78+
Diagnostic.HashCode = doc.GetHashCode();
7879
return doc;
7980
}
8081

0 commit comments

Comments
 (0)