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

GET/HEAD requests: do not attach query parameter if value is undefined #206

Closed
gr2m opened this issue Sep 23, 2020 · 1 comment · Fixed by #209
Closed

GET/HEAD requests: do not attach query parameter if value is undefined #206

gr2m opened this issue Sep 23, 2020 · 1 comment · Fixed by #209
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 requestOptions = endpoint("GET /repos/{owner}/{repo}/contents/{path}", {
  owner: "owner",
  repo: "repo",
  path: "path/to/file.txt",
  ref: undefined,
});

requestOptions.url is now "https://api.github.com/repos/owner/repo/contents/path%2Fto%2Ffile.txt?ref=undefined", but should be just "https://api.github.com/repos/owner/repo/contents/path%2Fto%2Ffile.txt"

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
@gr2m gr2m closed this as completed in #209 Oct 5, 2020
@github-actions
Copy link

github-actions bot commented Oct 5, 2020

🎉 This issue has been resolved in version 6.0.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging a pull request may close this issue.

1 participant