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
OpenApiError.Pointer skips a level if extension parser throws OpenApiException #501
if(node.Context.ExtensionParsersis not null&&node.Context.ExtensionParsers.TryGetValue(name,outvarparser))
And that's happening because the call to the parser should be surrounded by a try catch, and when an exception is thrown, it should be captured, the pointer amended, and logged as an error in the context with the right pointer.
Activity
KalleOlaviNiemitalo commentedon Jul 16, 2020
The extension parser itself cannot set OpenApiException.Pointer because it does not have enough information.
KalleOlaviNiemitalo commentedon Jul 16, 2020
I'd really prefer having a line number in the diagnostic but I'm not sure whether that could be implemented cleanly.
baywet commentedon Dec 22, 2025
Hi Kalle Olavi Niemitalo (@KalleOlaviNiemitalo)
Thank you for using the SDK and for reaching out.
Thank you for your patience.
This is implemented here (3 other instances)
OpenAPI.NET/src/Microsoft.OpenApi/Reader/V2/OpenApiV2Deserializer.cs
Line 80 in c4f798a
And that's happening because the call to the parser should be surrounded by a try catch, and when an exception is thrown, it should be captured, the pointer amended, and logged as an error in the context with the right pointer.
Additional tests should be added in this file.
OpenAPI.NET/test/Microsoft.OpenApi.Readers.Tests/TestCustomExtension.cs
Line 13 in c4f798a
I'll assign copilot to get a fix for this in v2 and v3, but we won't be addressing this in v1.
Let us know if you have any additional comments or questions.