You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 19, 2023. It is now read-only.
I'm trying to test my openapi scheme, but It's not working.
Exploring the source code, I found some problem.
If my schema does not have the basePath parameter, it takes the default value /.
Then RefResolver (from prance) calls to_posix before urlparse.
In fs.py file:
defto_posix(fname):
""" Convert a path to posix-like format. :param str fname: The filename to convert to posix format. :return: The filename in posix-like format. :rtype: str """importsysifsys.platform=="win32": # pragma: nocoverimportos.pathifos.path.isabs(fname):
fname="/"+fnamefname=fname.replace("\\", "/")
returnfname
If you call to_posix("/") on Windows, it will return "//".
Then urlparse will not be able to parse this value. And... this happened: prance.util.url.ResolutionError: Cannot build an absolute file URL from a fragment without a reference with path!
This is probably a feature of prance that you haven't considered. 'basePath' is your parameter and its default value doesn't work on Windows. If you think prance is the problem, create a new issue!
I use:
I'm trying to test my openapi scheme, but It's not working.
Exploring the source code, I found some problem.
If my schema does not have the
basePath
parameter, it takes the default value/
.Then
RefResolver
(fromprance
) callsto_posix
beforeurlparse
.In
fs.py
file:If you call
to_posix("/")
on Windows, it will return"//"
.Then
urlparse
will not be able to parse this value. And... this happened:prance.util.url.ResolutionError: Cannot build an absolute file URL from a fragment without a reference with path!
As a temporary solution I use:
But it can lead to other errors.
The text was updated successfully, but these errors were encountered: