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

Fix get_config to be compatible with openapi spec #39

Merged
merged 3 commits into from
Sep 4, 2023

Conversation

b3n4kh
Copy link
Contributor

@b3n4kh b3n4kh commented Aug 30, 2023

The regex replacement prevents using the servers directive as specified under: https://learn.openapis.org/specification/servers.html

Requiring from packaging.version import Version prevented me from cleanly building this package, and is a non-standard check since setuptools offers python_requires. I used minimum 3.8 as set by tox.ini.

swagger_ui/core.py Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved

version = config.get('openapi', '2.0.0')
if Version(version) >= Version('3.0.0'):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why delete these? I remember it use servers in openapi version 3 rather than host.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It used host rather than servers, it overrode every URL entry in servers with host, which is a behavior not defined at all in OpenAPI, but more importantly it prevented the standard use case of just setting a URL. If the old behavior is useful in someway, maybe it could be enabled via a configuration option?

setup.py Outdated Show resolved Hide resolved
@PWZER PWZER merged commit 4ebcfcd into PWZER:master Sep 4, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants