Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Comments

Close side panel

Remove return statement to eliminate NullReference exception#1062

Merged
MaggieKimani1 merged 1 commit intovnextmicrosoft/OpenAPI.NET:vnextfrom
mk/better-error-reportingmicrosoft/OpenAPI.NET:mk/better-error-reportingCopy head branch name to clipboard
Nov 7, 2022
Merged

Remove return statement to eliminate NullReference exception#1062
MaggieKimani1 merged 1 commit intovnextmicrosoft/OpenAPI.NET:vnextfrom
mk/better-error-reportingmicrosoft/OpenAPI.NET:mk/better-error-reportingCopy head branch name to clipboard

Conversation

@MaggieKimani1
Copy link
Contributor

@MaggieKimani1 MaggieKimani1 commented Nov 3, 2022

Returning a null value once an exception is caught and added to the diagnostics object raises a NullReferenceException as the new schema.Reference object created during schema deserialization is assigned a null value when trying to convert the schema into an OpenApiReference object as shown in this snippet.
Meanwhile, there's an actual reference object considering a reference pointer is found in the schema. This means that the value of the '$ref' passed is either unsupported or incorrect.

Fixes #1045

@MaggieKimani1 MaggieKimani1 merged commit 24a0817 into vnext Nov 7, 2022
@MaggieKimani1 MaggieKimani1 deleted the mk/better-error-reporting branch November 7, 2022 16:25
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.

Provide better error message when $ref points to something that is not a component.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.