rest.js icon indicating copy to clipboard operation
rest.js copied to clipboard

Inconsistent parameter naming: tag, tag_name

Open Richienb opened this issue 3 years ago • 2 comments

Checklist

  • [x] I checked all open bugs and none of them matched my problem.

Versions

+-- @octokit/[email protected]
| +-- @octokit/[email protected]
| | +-- @octokit/[email protected]
| | +-- @octokit/[email protected]
| | +-- @octokit/[email protected]
| | | +-- @octokit/[email protected]
| | | +-- @octokit/[email protected]
| | +-- @octokit/[email protected]
| +-- @octokit/[email protected]
| +-- @octokit/[email protected]
| `-- @octokit/[email protected]

What happened?

octokit.repos.createRelease uses tag_name but octokit.repos.getReleaseByTag uses tag.

What did you expect to happen?

They should be consistently named.

Richienb avatar Oct 28 '20 06:10 Richienb

I'm afraid I cannot help with that. The methods are a 1:1 mapping of GitHub's REST API, with all its little flaws. See

  • https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#create-a-release
  • https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#get-a-release-by-tag-name

It might be worth renaming the URL parameters. We did that in the past in order to make the REST API more coherent. That would need to be fixed in https://github.com/github/rest-api-description/, both the docs and the Octokit SDKs are generated from it. Would you like to file an issue there? No worries if not, I'll look into it eventually

gr2m avatar Oct 28 '20 07:10 gr2m

https://github.com/github/rest-api-description/issues/182

oscard0m avatar Jan 23 '21 22:01 oscard0m