Skip to content

Fix client request url construction when colon in path#313

Merged
deepmap-marcinr merged 2 commits intooapi-codegen:masterfrom
bvwells:312
Mar 18, 2021
Merged

Fix client request url construction when colon in path#313
deepmap-marcinr merged 2 commits intooapi-codegen:masterfrom
bvwells:312

Conversation

@bvwells
Copy link
Copy Markdown
Contributor

@bvwells bvwells commented Mar 5, 2021

Fix client request url construction when colon in path. Fixes issue #312.

@bvwells
Copy link
Copy Markdown
Contributor Author

bvwells commented Mar 18, 2021

@deepmap-marcinr thanks for the review and merge!

@rkojedzinszky
Copy link
Copy Markdown
Contributor

Unfortunately, this breaks cases when a request parameter contains '/'. Earlier, this got escaped well, now an argument of 'main/i' gets escaped as: main%252Fi.

@bvwells
Copy link
Copy Markdown
Contributor Author

bvwells commented Mar 18, 2021

@rkojedzinszky can you provide an example spec and I'll take a look. Could you also let me know which version of oapi-codegen you were previously using please?

@rkojedzinszky
Copy link
Copy Markdown
Contributor

rkojedzinszky commented Mar 18, 2021

@bvwells I used latest, v1.5.2. The spec is a freenas 11.3 openapi, attached.
freenas-11.3-openapi.json.gz

For example, at path /pool/dataset/id/{id} the id parameter may be a zfs dataset, containing /.

deepmap-marcinr pushed a commit that referenced this pull request Mar 19, 2021
This reverts commit 720dae1. It broke
path handling in a different way. We will fix this differently.
@deepmap-marcinr
Copy link
Copy Markdown
Contributor

I've got a fix for this which does what @bvwells did in the client, but he missed the corresponding server side change to unescape arguments, so I fixed that side as well.

Your code used to work @rkojedzinszky because we got lucky to be consistently wrong :)

@bvwells
Copy link
Copy Markdown
Contributor Author

bvwells commented Mar 19, 2021

Sorry for missing this on the server side. Glad we got to the bottom of it as I couldn't work out what was wrong client side.

adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
)

Co-authored-by: Marcin Romaszewicz <47459980+deepmap-marcinr@users.noreply.github.com>
adrianpk pushed a commit to foorester/oapi-codegen that referenced this pull request Jan 16, 2024
…codegen#313)"

This reverts commit 6120688. It broke
path handling in a different way. We will fix this differently.
adrianpk added a commit to foorester/oapi-codegen that referenced this pull request May 31, 2024
…codegen#313)"

This reverts commit 720dae1. It broke
path handling in a different way. We will fix this differently.
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.

3 participants