Skip to content

Document reader parser-level exceptions - #3078

Draft
Vincent Biret (baywet) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-openapi-yaml-reader-behavior
Draft

Document reader parser-level exceptions#3078
Vincent Biret (baywet) with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-openapi-yaml-reader-behavior

Conversation

Copilot AI commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Pull Request

Description

Clarifies reader behavior when input is invalid before OpenAPI parsing begins. ReadResult.Diagnostic covers OpenAPI semantic errors; JSON/YAML syntax-level failures may throw before a result can be created.

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)

Linked by automation.

Changes Made

  • Added XML remarks to IOpenApiReader read and fragment APIs.
  • Documented JSON/YAML parser-level exception behavior on concrete reader entry points.
  • Propagated the same contract to OpenApiModelFactory and OpenApiDocument convenience APIs.

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:
  • 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

Documentation-only change; no runtime behavior changes.

Co-authored-by: baywet <7905502+baywet@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix inconsistent behavior in OpenApiYamlReader.Read for error handling Document reader parser-level exceptions Sep 10, 2026
writer.WriteOptionalCollection(OpenApiConstants.Schemes, schemes, (w, s) =>
{
if(!string.IsNullOrEmpty(s) && s is not null)
if (!string.IsNullOrEmpty(s) && s is not null)
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.

OpenApiYamlReader.Read inconsistent behavior for errors

2 participants