Fix relative URL refs with path-only root ids#3085
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughModified Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Merging this PR will not alter performance
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3085 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 87 87
Lines 18274 18300 +26
Branches 2089 2090 +1
=========================================
+ Hits 18274 18300 +26
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Breaking Change AnalysisResult: No breaking changes detected Reasoning: This PR is a bug fix for URL resolution when fetching schemas via This analysis was performed by Claude Code Action |
|
🎉 Released in 0.56.1 This PR is now available in the latest release. See the release notes for details. |
Summary
$idvalues against the retrieval URL before using them as the base for relative$refresolution$idplusbase_url--urlinput with path-only$idand relative external$refRoot Cause
When a schema was fetched via
--urland declared a path-only root$idlike/schemas/v1/main.schema.json, that$idreplaced the retrieval URL as the reference base without first being normalized to an absolute URL. The next relative$refwas therefore resolved as a local filesystem path instead of remaining remote.Validation
tox -e typetox -e readmetox -e cli-docs -- --checktox -e config-types -- --checktox -e py314-parallel -- tests/test_reference.py tests/main/jsonschema/test_main_jsonschema.py -k 'relative_root_id or root_id_differs_from_base_url or url_with_relative_root_id_resolves_relative_refs or root_id_jsonschema_with_remote_file or remote_ref'tox -e py312-parallel -- tests/test_reference.py tests/main/jsonschema/test_main_jsonschema.py -k 'relative_root_id or root_id_differs_from_base_url or url_with_relative_root_id_resolves_relative_refs or root_id_jsonschema_with_remote_file or remote_ref'Fixes: #3080
Summary by CodeRabbit
Bug Fixes
$refreferences when using remote schemas with relative root$idpaths. Relative references now correctly resolve against the provided base URL.Tests