You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No error when deserializing a wrong reference. #1693
Describe the bug
If a specification has a wrong reference pointer (a response pointing to a schema reference for instance.) no error is pushed to diagnostics and the response will end up simply being null.
Expected behavior
An error should be pushed to Diagnostics, that the reference could not be resolved.
Notes
The behaviour stems from the as T cast in ResolveReference<T> - which for a reference that doesn't match, simply results in null.
A simple solution could be to add a null check in the ResolveReference<T>(OpenApiReference reference) method in OpenApiReferenceResolver (the base one that all of the other Resolve methods use.
Activity
MaggieKimani1 commentedon Jun 20, 2024
You're right this is a bug, this should be appended to the diagnostics object as an error. Fixing..