Skip to content
New issue

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

HTTP Relative URL support in $ref #112

Open
wcloete opened this issue Aug 3, 2021 · 1 comment
Open

HTTP Relative URL support in $ref #112

wcloete opened this issue Aug 3, 2021 · 1 comment

Comments

@wcloete
Copy link

wcloete commented Aug 3, 2021

Expected Behaviour

The OpenAPI 3.0 spec supports relative URLs in $ref definitions, but currently this ends up in a call to util.url.absurl which specifies that

Non-file URLs are left untouched.

So this results in a ResolutionError when using ResolvingParser on a server with its api in multiple files.

My question then is whether you would be open to a PR to add support for http(s) to util.url.absurl, or is this intentionally unsupported by design? (it seems like another 5-10 lines are needed) Or am I underestimating the problem?

Minimal Example Spec

To give you a working example I would have to expose my web server on the internet, but if you need more info I'll gladly provide.

Actual Behaviour

A ResolutionError is raised when using ResolvingParser on a server with its api in multiple files specified using relative URLs.

Steps to Reproduce

Environment

  • OS: macOS Catalina
  • Python version: 3.7
  • Swagger/OpenAPI version used: 3.0.0
  • Backend: N/A
@wcloete
Copy link
Author

wcloete commented Oct 11, 2022

I think I've fixed this, (possibly only partly) in https://github.com/wcloete/prance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants