Add `file://` to self links that don't have a protocol
Related Issue(s):
- closes #1347
Description:
Pystac already coerces self links to absolute, so now it adds file:// as well.
Notes:
- TODO: There are still some tests that are failing. Mostly having to do with
normalize. - The json schema spec does define how
"format": "iri"should be handled, but the Python implementation doesn't seem to validate it very well. For instance this passes:
from jsonschema import validate
validate("any-string", {"type": "string", "format": "iri", "minLength": 1})
- Python in general seems rather bad at interpreting the
file://protocol. Python 3.13 adds some support topathlibin https://docs.python.org/3/library/pathlib.html#pathlib.Path.from_uri
PR Checklist:
Hey there, let me know if you want me to take on any of the todos above, and if so if I should PR to your branch. No worries if you'd rather just stay heads down!
Hey there, let me know if you want me to take on any of the todos above, and if so if I should PR to your branch. No worries if you'd rather just stay heads down!
Yeah the more I have been thinking about this PR the more I think it should be considered a breaking change and wait until pystac 2.0. Part of the reason why I am leaning that way is because the jsonschema validation does not raise.