We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fields.Url
file
Run this test case:
import marshmallow as mm class LOL(mm.Schema): url = mm.fields.Url(schemes={'file'}) LOL().load(dict(url="file:///var/storage/somefile.zip"))
{'url': 'file:///var/storage/somefile.zip'}
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/Users/nisimond/work/blastarea/lolwut/lib/python3.11/site-packages/marshmallow/schema.py", line 756, in loads return self.load(data, many=many, partial=partial, unknown=unknown) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/nisimond/work/blastarea/lolwut/lib/python3.11/site-packages/marshmallow/schema.py", line 722, in load return self._do_load( ^^^^^^^^^^^^^^ File "/Users/nisimond/work/blastarea/lolwut/lib/python3.11/site-packages/marshmallow/schema.py", line 909, in _do_load raise exc marshmallow.exceptions.ValidationError: {'url': ['Not a valid URL.']}
This works:
LOL().load(dict(url="file://localhost/var/storage/somefile.zip"))
...but the hostname portion is entirely optional with file URLs.
hostname
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Steps to reproduce
Run this test case:
Expected result
Actual behavior
Workaround
This works:
...but the
hostname
portion is entirely optional withfile
URLs.The text was updated successfully, but these errors were encountered: