Skip to content

Commit b71bb5d

Browse files
committed
apistar: Rename variables api_theme -> openapi_theme, etc.
1 parent 27a9459 commit b71bb5d

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

responder/api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
from .formats import get_formats
1818
from .routes import Router
1919
from .staticfiles import StaticFiles
20-
from .statics import DEFAULT_API_THEME, DEFAULT_CORS_PARAMS, DEFAULT_SECRET_KEY
20+
from .statics import DEFAULT_CORS_PARAMS, DEFAULT_OPENAPI_THEME, DEFAULT_SECRET_KEY
2121
from .templates import Templates
2222

2323

@@ -28,7 +28,7 @@ class API:
2828
:param templates_dir: The directory to use for templates. Will be created for you if it doesn't already exist.
2929
:param auto_escape: If ``True``, HTML and XML templates will automatically be escaped.
3030
:param enable_hsts: If ``True``, send all responses to HTTPS URLs.
31-
:param api_theme: OpenAPI documentation theme, must be one of ``elements``, ``rapidoc``, ``redoc``, ``swagger_ui``
31+
:param openapi_theme: OpenAPI documentation theme, must be one of ``elements``, ``rapidoc``, ``redoc``, ``swagger_ui``
3232
""" # noqa: E501
3333

3434
status_codes = status_codes
@@ -55,7 +55,7 @@ def __init__(
5555
cors=False,
5656
cors_params=DEFAULT_CORS_PARAMS,
5757
allowed_hosts=None,
58-
api_theme=DEFAULT_API_THEME,
58+
openapi_theme=DEFAULT_OPENAPI_THEME,
5959
):
6060
self.background = BackgroundQueue()
6161

@@ -122,7 +122,7 @@ def __init__(
122122
license=license,
123123
openapi_route=openapi_route,
124124
static_route=static_route,
125-
api_theme=api_theme,
125+
openapi_theme=openapi_theme,
126126
)
127127

128128
# TODO: Update docs for templates

responder/ext/schema/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from apispec.ext.marshmallow import MarshmallowPlugin
55

66
from responder import status_codes
7-
from responder.statics import API_THEMES, DEFAULT_API_THEME
7+
from responder.statics import API_THEMES, DEFAULT_OPENAPI_THEME
88
from responder.templates import Templates
99

1010

@@ -23,7 +23,7 @@ def __init__(
2323
openapi_route="/schema.yml",
2424
docs_route="/docs/",
2525
static_route="/static",
26-
api_theme=DEFAULT_API_THEME,
26+
openapi_theme=DEFAULT_OPENAPI_THEME,
2727
):
2828
self.app = app
2929
self.schemas = {}
@@ -37,7 +37,9 @@ def __init__(
3737
self.openapi_version = openapi
3838
self.openapi_route = openapi_route
3939

40-
self.docs_theme = api_theme if api_theme in API_THEMES else DEFAULT_API_THEME
40+
self.docs_theme = (
41+
openapi_theme if openapi_theme in API_THEMES else DEFAULT_OPENAPI_THEME
42+
)
4143
self.docs_route = docs_route
4244

4345
self.plugins = [MarshmallowPlugin()] if plugins is None else plugins

responder/statics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
API_THEMES = ["elements", "rapidoc", "redoc", "swagger_ui"]
22
DEFAULT_ENCODING = "utf-8"
3-
DEFAULT_API_THEME = "swagger_ui"
3+
DEFAULT_OPENAPI_THEME = "swagger_ui"
44
DEFAULT_SESSION_COOKIE = "Responder-Session"
55
DEFAULT_SECRET_KEY = "NOTASECRET" # noqa: S105
66

0 commit comments

Comments
 (0)