fastapi-swagger 0.2.1__py3-none-any.whl → 0.2.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of fastapi-swagger might be problematic. Click here for more details.

fastapi_swagger/main.py CHANGED
@@ -1,3 +1,4 @@
1
+ import warnings
1
2
  from importlib import resources
2
3
  from typing import Optional, Dict, Any
3
4
 
@@ -11,7 +12,7 @@ def patch_fastapi(
11
12
  docs_url: str = "/docs",
12
13
  redirect_from_root_to_docs: bool = True,
13
14
  *,
14
- title: Optional[str],
15
+ title: Optional[str] = None,
15
16
  swagger_js_url: str = "/swagger/swagger-ui-bundle.js", # relative path from app root
16
17
  swagger_css_url: str = "/swagger/swagger-ui.css", # relative path from app root
17
18
  swagger_favicon_url: str = "/swagger/favicon-32x32.png", # relative path from app root
@@ -34,6 +35,18 @@ def patch_fastapi(
34
35
  :param init_oauth: OAuth2 configuration
35
36
  :param oauth2_redirect_url: OAuth2 redirect URL
36
37
  """
38
+ # docs_url=None, swagger_ui_oauth2_redirect_url=None should be set in FastAPI app definition
39
+ if getattr(app, "docs_url", None) is not None:
40
+ warnings.warn(
41
+ "`docs_url` is set in FastAPI app definition, please, set it to None",
42
+ UserWarning,
43
+ )
44
+ if getattr(app, "swagger_ui_oauth2_redirect_url", None) is not None:
45
+ warnings.warn(
46
+ "`swagger_ui_oauth2_redirect_url` is set in FastAPI app definition, please, set it to None",
47
+ UserWarning,
48
+ )
49
+
37
50
  if redirect_from_root_to_docs:
38
51
 
39
52
  @app.get("/", include_in_schema=False)
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: fastapi-swagger
3
- Version: 0.2.1
4
- Summary:
3
+ Version: 0.2.3
4
+ Summary: This plugin updates the FastAPI app to host latest Swagger UI distribution.
5
5
  Home-page: https://github.com/dantetemplar/fastapi-swagger
6
6
  License: MIT
7
7
  Author: Ruslan Bel'kov
@@ -1,10 +1,10 @@
1
1
  fastapi_swagger/__init__.py,sha256=REdpIZbBR4KKvMWgNSQX2U7iVQd2-98axP5gIv8gJJ0,61
2
- fastapi_swagger/main.py,sha256=MXJbXJV2hU3HyNSmUoS37Zdw3KSp0pd8rEWORCpPgk8,3913
2
+ fastapi_swagger/main.py,sha256=VZWOSG3X_3XkQ-uQ8vTQsJGCx0p_HXeY6nKeDdv-Gyg,4462
3
3
  fastapi_swagger/resources/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  fastapi_swagger/resources/favicon-32x32.png,sha256=PtYS9B4FDKXnAAytbxy-fn2jn2X8qZwC6Z5lkQVuWDc,628
5
5
  fastapi_swagger/resources/swagger-ui-bundle.js,sha256=wuSp7wgUSDn_R8FCAgY-z-TlnnCk5xVKJr1Q2IDIi6E,1452753
6
6
  fastapi_swagger/resources/swagger-ui.css,sha256=QBcPDuhZ0X-SExunBzKaiKBw5PZodNETZemnfSMvYRc,152071
7
- fastapi_swagger-0.2.1.dist-info/LICENSE,sha256=lL2KMWfisKNKDZ7e-vZ8oQ_MZ6UthgAP5qtIm4HBdCs,1070
8
- fastapi_swagger-0.2.1.dist-info/METADATA,sha256=ljfg5KEeFE5_do_h9cyh6QMBdXYFMpUvy3TJA1vqIZk,3396
9
- fastapi_swagger-0.2.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
10
- fastapi_swagger-0.2.1.dist-info/RECORD,,
7
+ fastapi_swagger-0.2.3.dist-info/LICENSE,sha256=lL2KMWfisKNKDZ7e-vZ8oQ_MZ6UthgAP5qtIm4HBdCs,1070
8
+ fastapi_swagger-0.2.3.dist-info/METADATA,sha256=JIIiJqcxNZT4yVr9jp15rcwJ31pUmxkhARW84hACvSk,3471
9
+ fastapi_swagger-0.2.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
10
+ fastapi_swagger-0.2.3.dist-info/RECORD,,