Skip to content

Path parameters as function positional arguments #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Pass endpoint instead of endpoint.path_parameters to ParseError
  • Loading branch information
tsotnikov committed May 25, 2021
commit dbd3f1b31e8f414ec3afef20ec0c6da3a5d4edfe
2 changes: 1 addition & 1 deletion openapi_python_client/parser/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def _sort_parameters(*, endpoint: "Endpoint", path: str) -> Union["Endpoint", Pa
path_parameter_names = [p.name for p in endpoint.path_parameters]
if parameters_from_path != path_parameter_names:
return ParseError(
data=endpoint.path_parameters,
data=endpoint,
detail="Incorrect path templating (Path parameters do not match with path)",
)
return endpoint
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parser/test_openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ def test__sort_parameters_invalid_path_templating(self, mocker):
result = Endpoint._sort_parameters(endpoint=endpoint, path=path)

assert isinstance(result, ParseError)
assert result.data == [param]
assert result.data == endpoint
assert "Incorrect path templating" in result.detail

def test_from_data_bad_params(self, mocker):
Expand Down