Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
millicentachieng committed Sep 8, 2022
1 parent 9b4a0ef commit 61fcb9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Microsoft.OpenApi.Readers/OpenApiYamlDocumentReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ public OpenApiDocument Read(YamlDocument input, out OpenApiDiagnostic diagnostic
if (_settings.RuleSet != null && _settings.RuleSet.Rules.Count > 0)
{
var openApiErrors = document.Validate(_settings.RuleSet);
foreach (var item in openApiErrors.Where(e => e is OpenApiValidatorError))
foreach (var item in openApiErrors.OfType<OpenApiValidatorError>())
{
diagnostic.Errors.Add(item);
}
foreach (var item in openApiErrors.Where(e => e is OpenApiValidatorWarning))
foreach (var item in openApiErrors.OfType<OpenApiValidatorWarning>())
{
diagnostic.Warnings.Add(item);
}
Expand Down Expand Up @@ -115,11 +115,11 @@ public async Task<ReadResult> ReadAsync(YamlDocument input)
if (_settings.RuleSet != null && _settings.RuleSet.Rules.Count > 0)
{
var openApiErrors = document.Validate(_settings.RuleSet);
foreach (var item in openApiErrors.Where(e => e is OpenApiValidatorError))
foreach (var item in openApiErrors.OfType<OpenApiValidatorError>())
{
diagnostic.Errors.Add(item);
}
foreach (var item in openApiErrors.Where(e => e is OpenApiValidatorWarning))
foreach (var item in openApiErrors.OfType<OpenApiValidatorWarning>())
{
diagnostic.Warnings.Add(item);
}
Expand Down

0 comments on commit 61fcb9f

Please sign in to comment.