Skip to content
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

Trim method path parameters of leading slashes #713

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

nfx
Copy link
Contributor

@nfx nfx commented Nov 27, 2023

Changes

Fundamentally prevent regressions like

PUT /api/2.0/fs/files//Volumes/main/x/y/z
> [non-JSON document of 11 bytes]. <io.Reader>
< HTTP/2.0 400 Bad Request
< {
<   "error_code": "BAD_REQUEST",
<   "message": "Invalid path"
< }

Fundamentally prevent regressions like

```
 PUT /api/2.0/fs/files//Volumes/main/x/y/z
> [non-JSON document of 11 bytes]. <io.Reader>
< HTTP/2.0 400 Bad Request
< {
<   "error_code": "BAD_REQUEST",
<   "message": "Invalid path"
< }
```
@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2023

Codecov Report

Attention: 238 lines in your changes are missing coverage. Please review.

Comparison is base (af0eafe) 16.34% compared to head (3465497) 16.34%.

Files Patch % Lines
service/catalog/impl.go 0.00% 66 Missing ⚠️
service/iam/impl.go 0.00% 32 Missing ⚠️
service/sql/impl.go 0.00% 29 Missing ⚠️
service/sharing/impl.go 0.00% 19 Missing ⚠️
service/compute/impl.go 0.00% 16 Missing ⚠️
service/provisioning/impl.go 0.00% 16 Missing ⚠️
service/settings/impl.go 0.00% 16 Missing ⚠️
service/workspace/impl.go 0.00% 14 Missing ⚠️
service/pipelines/impl.go 0.00% 13 Missing ⚠️
service/ml/impl.go 0.00% 8 Missing ⚠️
... and 2 more
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #713   +/-   ##
=======================================
  Coverage   16.34%   16.34%           
=======================================
  Files          98       98           
  Lines       13996    13996           
=======================================
  Hits         2287     2287           
  Misses      11518    11518           
  Partials      191      191           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nfx nfx requested a review from pietern November 27, 2023 09:43
Copy link
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regenerating the SDK with this change does not change the generated code. The issue is that users can specify an initial / in this parameter, and it is documented as The absolute path of the file or directory in DBFS., where absolute paths begin with a /. However, if they do that, the path contains two consecutive /s.

@nfx nfx changed the title Trim method path suffix of redundant trailing slashes Trim method path parameters of leading slashes Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants