|
@@ -53,6 +53,7 @@ def run(*,
|
|
|
uvicorn_reload_includes: str = '*.py',
|
|
|
uvicorn_reload_excludes: str = '.*, .py[cod], .sw.*, ~*',
|
|
|
tailwind: bool = True,
|
|
|
+ endpoint_documentation: Literal['none', 'internal', 'page', 'all'] = 'none',
|
|
|
storage_secret: Optional[str] = None,
|
|
|
**kwargs: Any,
|
|
|
) -> None:
|
|
@@ -79,6 +80,7 @@ def run(*,
|
|
|
:param uvicorn_reload_includes: string with comma-separated list of glob-patterns which trigger reload on modification (default: `'.py'`)
|
|
|
:param uvicorn_reload_excludes: string with comma-separated list of glob-patterns which should be ignored for reload (default: `'.*, .py[cod], .sw.*, ~*'`)
|
|
|
:param tailwind: whether to use Tailwind (experimental, default: `True`)
|
|
|
+ :param endpoint_documentation: control what endpoints appear in the autogenerated OpenAPI docs (default: 'none', options: 'none', 'internal', 'page', 'all')
|
|
|
:param storage_secret: secret key for browser based storage (default: `None`, a value is required to enable ui.storage.individual and ui.storage.browser)
|
|
|
:param kwargs: additional keyword arguments are passed to `uvicorn.run`
|
|
|
'''
|
|
@@ -91,6 +93,13 @@ def run(*,
|
|
|
globals.language = language
|
|
|
globals.binding_refresh_interval = binding_refresh_interval
|
|
|
globals.tailwind = tailwind
|
|
|
+ globals.endpoint_documentation = endpoint_documentation
|
|
|
+
|
|
|
+ for route in globals.app.routes:
|
|
|
+ if route.path.startswith('/_nicegui') and hasattr(route, 'methods'):
|
|
|
+ route.include_in_schema = endpoint_documentation in {'internal', 'all'}
|
|
|
+ if route.path == '/' or route.path in globals.page_routes.values():
|
|
|
+ route.include_in_schema = endpoint_documentation in {'page', 'all'}
|
|
|
|
|
|
if on_air:
|
|
|
globals.air = Air('' if on_air is True else on_air)
|