Closed jbenaventem closed 4 months ago
Assuming you have no objections, I would like to initiate the collaboration process.
@jbenaventem
REST API Docs:
For Create
, the only parameters for template-based creation are template_owner
and template_repo
. There's no template_repository
.
For the builder related to Create
, since there isn't a template_repository
field, I agree you could add an overload for fromTemplateRepository
that takes a GHRepository
instance and then pulls the owner
and repo
from the instance. That would be a nice convenience.
For Update
, the API does not support changing template_repository
. So, there's no setTemplateRepository()
.
For Read
, I agree we should have a method that returns the template repository details.
This looks similar to #1549 and associated PR #1579 .
I'm currently working on a project where I need to retrieve the information of the template repository from which a repository was created. However, it seems that the current version of the GitHub API kosuke library does not support this feature. Here's an example of how I'm trying to use this feature:
In this code, I'm creating a new repository from a template repository. After the repository is created, I'm trying to retrieve the template repository information using repoFind.getTemplateRepository(). However, this method does not exist in the current version of the library.
Proposed Solution
I propose adding a new method to the GHRepository class that allows retrieving the template repository information. This method could return a GHRepository object representing the template repository. Here's a rough idea of how this could be implemented:
GHRepository.java
And In the abstract class GHRepositoryBuilder (I'm not absolutly sure about this method is needed)