Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove return statement to eliminate NullReference exception #1062

Merged
merged 1 commit into from
Nov 7, 2022

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