Commit 5497e5a
committed
fix: skip local sibling probe in _preferLocalBaseForRemoteId for non-file:// schemas
When a schema is loaded from an https:// URL (e.g. via a VS Code YAML
extension contributor), _preferLocalBaseForRemoteId extracts the basename
from sub-schema $id values and probes for them as local siblings. This
causes spurious HTTP requests that fail with 404 errors.
For example, loading openapi.v3.1.yaml (with $id pointing to
github.com/.../schema.yaml) from an https:// contributor causes a probe
for <contributor-base>/schema.yaml, which does not exist.
The companion function _resolveLocalSiblingFromRemoteUri already guards
against this with `if (parentUri.scheme !== 'file') return undefined`.
Apply the same scheme guard to _preferLocalBaseForRemoteId so the local
sibling optimization only fires for file:// schemas where it makes sense.
Made-with: Cursor1 parent d0b52a8 commit 5497e5a
File tree
2 files changed
+48
-0
lines changed- src/languageservice/services
- test
2 files changed
+48
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
350 | 350 | | |
351 | 351 | | |
352 | 352 | | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
353 | 356 | | |
354 | 357 | | |
355 | 358 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
406 | 406 | | |
407 | 407 | | |
408 | 408 | | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
409 | 454 | | |
410 | 455 | | |
411 | 456 | | |
| |||
0 commit comments