Skip to content

Commit

Permalink
Remove "plugin" querystring from api doc
Browse files Browse the repository at this point in the history
We introduced the component parameter to accept app labels instead.

[noissue]
  • Loading branch information
mdellweg committed Jun 12, 2024
1 parent 9e9198c commit 59d5f9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 2 additions & 0 deletions CHANGES/+apidoc_plugin.removal
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Removed deprecated `plugin` query string parameter from api doc endpoint.
Please use a list of app labels with the `component` parameter instead.
15 changes: 2 additions & 13 deletions pulpcore/openapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,27 +475,16 @@ def get_schema(self, request=None, public=False):
reset_generator_stats()

apps = list(pulp_plugin_configs())
if request and "plugin" in request.query_params:
raise ParseError("'plugin' has been removed. Use 'component' instead.")
if request and "component" in request.query_params:
# /pulp/api/v3/docs/api.json?component=core,file
if "plugin" in request.query_params:
raise ParseError("'component' and 'plugin' cannot be combined.")
app_labels = request.query_params["component"].split(",")
apps = [app for app in apps if app.label in app_labels]
if len(apps) != len(app_labels):
raise ParseError("Invalid component specified.")
request.plugins = [app.name.split(".")[0] for app in apps]

if request and "plugin" in request.query_params:
# /pulp/api/v3/docs/api.json?plugin=pulp_file
deprecation_logger.warn(
_(
"The query parameter `plugin` has been deprecated and "
"will be removed with pulpcore>=3.55. "
"Please use `component` with a list of app labels instead."
)
)
request.plugins = request.query_params["plugin"].split(",")

result = build_root_object(
paths=self.parse(request, public),
components=self.registry.build(spectacular_settings.APPEND_COMPONENTS),
Expand Down

0 comments on commit 59d5f9a

Please sign in to comment.