github-api icon indicating copy to clipboard operation
github-api copied to clipboard

Make low-level Requester and GitHubClient APIs public

Open Vampire opened this issue 6 years ago • 3 comments

For being able to use missing API functionality it would be nice if the Requester would be accessible, so that the low-level requests can be done manually or e. g. with Kotlin extension functions, but still having the lib do rate limiting and so on.

Vampire avatar Apr 12 '19 22:04 Vampire

@Vampire Seems easy enough (public in a few places). I'm a little concerned though, as then then we'd be committed to the API of the Requester and supporting it.

bitwiseman avatar Oct 11 '19 22:10 bitwiseman

This can be done in Groovy already, but isn't possible in Java. Probably not in Kotlin either: image

GHRepository deleteSecret(GHRepository repo, String key) {
    // must use the raw request because kohsuke doesn't have a secret delete yet.
    repo.getRoot()
        .createRequest() // thank you Groovy for allowing this.
        .method("DELETE")
        .withUrlPath("/repos/${repo.getFullName()}/actions/secrets/${key}")
        .send()
    return repo
  }

ranma2913 avatar Aug 28 '24 16:08 ranma2913

Of course, with Groovy you can even access private stuff easily. And you can do it in Java or Kotlin too with using reflection. But whether you should do it, is a different question, and a stable public API would be preferable

Vampire avatar Aug 28 '24 16:08 Vampire