Skip to content

fix: harden yaml parsing - #3027

Merged
Gavin Barron (gavinbarron) merged 4 commits into
mainfrom
fix/harden-yaml-loading-guards
Aug 19, 2026
Merged

fix: harden yaml parsing#3027
Gavin Barron (gavinbarron) merged 4 commits into
mainfrom
fix/harden-yaml-loading-guards

Conversation

@gavinbarron

Copy link
Copy Markdown
Contributor

Pull Request

Description

Improved safety when loading OAS documents from YAML inputs

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Other (please describe):

Related Issue(s)

Changes Made

Checks loading via streams via SharpYaml events
Adds alias budget
Adds new helpers for AddYamlReader

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed
  • All existing tests pass

Checklist

  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Versions applicability

  • My change applies to the version 1.X of the library, if so PR link:
  • My change applies to the version 2.X of the library, if so PR link:
  • My change applies to the version 3.X of the library, if so PR link: this one...
  • I have evaluated the applicability of my change against the other versions above.

See the contributing guidelines for more information about how patches are applied across multiple versions.

Additional Notes

@gavinbarron
Gavin Barron (gavinbarron) requested a review from a team as a code owner August 18, 2026 21:01
Comment thread src/Microsoft.OpenApi/Validations/Rules/OpenApiSchemaRules.cs Fixed
Comment thread src/Microsoft.OpenApi.YamlReader/YamlConverter.cs
Comment thread src/Microsoft.OpenApi.YamlReader/YamlJsonParser.cs Fixed
Comment thread src/Microsoft.OpenApi.YamlReader/YamlConverter.cs Dismissed
Comment thread src/Microsoft.OpenApi/Validations/Rules/OpenApiSchemaRules.cs Fixed
@github-code-quality

github-code-quality Bot commented Aug 18, 2026

Copy link
Copy Markdown

Code Coverage Overview

Languages: C#

C# / code-coverage/dotnet

The overall coverage in commit 684c8d6 in the fix/harden-yaml-load... branch remains at 89%, unchanged from commit 39a80f3 in the main branch.

Show a code coverage summary of the most impacted files.
File main 39a80f3 fix/harden-yaml-load... 684c8d6 +/-
/home/runner/wo...amlConverter.cs 90% 89% -1%
/home/runner/wo...gsExtensions.cs 100% 100% 0%
/home/runner/wo...iSchemaRules.cs 93% 97% +4%
/home/runner/wo...derException.cs 67% 83% +16%
/home/runner/wo...piYamlReader.cs 74% 92% +18%
/home/runner/wo...mlJsonParser.cs 0% 86% +86%
/home/runner/wo...ersionBudget.cs 0% 91% +91%
/home/runner/wo...aderSettings.cs 0% 100% +100%

Updated August 18, 2026 23:23 UTC

@sonarqubecloud

Copy link
Copy Markdown

@gavinbarron
Gavin Barron (gavinbarron) merged commit e0d5e9d into main Aug 19, 2026
19 checks passed
@gavinbarron
Gavin Barron (gavinbarron) deleted the fix/harden-yaml-loading-guards branch August 19, 2026 00:42
Gavin Barron (gavinbarron) added a commit that referenced this pull request Aug 19, 2026
Vincent Biret (baywet) pushed a commit that referenced this pull request Aug 19, 2026
This was referenced Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants