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

URL parameter encoding differs depending on notation ({param} vs :param) #207

Closed
gr2m opened this issue Sep 23, 2020 · 2 comments
Closed
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented

Comments

@gr2m
Copy link
Contributor

gr2m commented Sep 23, 2020

Example

const { url: url1 } = endpoint("GET /repos/{owner}/{repo}/contents/{path}", {
  owner: "owner",
  repo: "repo",
  path: "path/to/file.txt"
});
const { url: url2 } = endpoint("GET /repos/:owner/:repo/contents/:path", {
  owner: "owner",
  repo: "repo",
  path: "path/to/file.txt"
});

url1 is correct.

I'd appreciate a pull request if anyone would like to work on this. You can start out by creating a pull request with a failing test reproducing the above behavior. The test will go into test/endpoint.test.ts.

@gr2m gr2m added Type: Bug Something isn't working as documented Status: Up for grabs Issues that are ready to be worked on by anyone labels Sep 23, 2020
@romanbalayan
Copy link
Contributor

Hi @gr2m

I'm currently participating in the hacktoberfest event organized by Digital Ocean, hopefully it won't be too much of a bother for you to add the hacktoberfest-accepted label to this PR so it may be counted towards my progress.

Thank you!

@gr2m
Copy link
Contributor Author

gr2m commented Oct 13, 2020

resolved via #210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Up for grabs Issues that are ready to be worked on by anyone Type: Bug Something isn't working as documented
Projects
None yet
Development

No branches or pull requests

2 participants