Skip to content

Commit

Permalink
Reenable auto add path params
Browse files Browse the repository at this point in the history
  • Loading branch information
ahopkins committed Jan 19, 2022
1 parent b3c1560 commit c70768a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
23 changes: 11 additions & 12 deletions sanic_ext/extensions/openapi/blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,18 +113,17 @@ def build_spec(app, loop):
] = f"{method.lower()}~{route_name}"
operation._default["summary"] = clean_route_name(route_name)

# TODO: solve for this
# for _parameter in route_parameters:
# if any(
# (
# param.fields["name"] == _parameter.name
# for param in operation.parameters
# )
# ):
# continue
# operation.parameter(
# _parameter.name, _parameter.cast, "path"
# )
for _parameter in route_parameters:
if any(
(
param.fields["name"] == _parameter.name
for param in operation.parameters
)
):
continue
operation.parameter(
_parameter.name, _parameter.cast, "path"
)

specification.operation(uri, method, operation)

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = sanic-ext
version = 22.1.0
version = 22.1.1
url = http://github.com/sanic-org/sanic-ext/
license = MIT
author = Sanic Community
Expand Down

0 comments on commit c70768a

Please sign in to comment.