Update locEnd implementation in OpenAPI parser to handle content length more robustly

This commit is contained in:
Luke Hagar
2025-11-10 18:21:01 +00:00
parent 90ad4349b7
commit c9b1a4b08b

View File

@@ -328,7 +328,7 @@ export const parsers: Record<string, Parser> = {
}, },
astFormat: "openapi-ast", astFormat: "openapi-ast",
locStart: (node: OpenAPINode) => 0, locStart: (node: OpenAPINode) => 0,
locEnd: (_node: OpenAPINode, text: string) => text.length, locEnd: (node: OpenAPINode) => node.content?.length || 0,
}, },
}; };