Skip to content

make GetReposContentsByOwnerByRepoByPath path optional #81

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

szesch
Copy link

@szesch szesch commented Apr 18, 2025

The Github docs for getting repository content state

Gets the contents of a file or directory in a repository. Specify the file path or directory with the path parameter. If you omit the path parameter, you will receive the contents of the repository's root directory.

The docs are incorrect and mark the path as required. This PR makes the path optional.

@migueleliasweb
Copy link
Owner

migueleliasweb commented Apr 18, 2025

@szesch Thanks for the contribution!

Something that will play a role here is that the endpointspattern.go file is actually auto generated so we can't directly modify it.

There are a few other endpoints like this where the default regular expression is not quite correct. To modify it, you can look here for an example. You'll see that it intercepts the generation and allows us to define a different expression like you did.

After creating a new expression you can then run the gen.go so regenerate all endpoints with their new definitions.

Give it a go and I'm happy to review your change and get it merged.

trumant added a commit to trumant/go-github-mock that referenced this pull request Apr 21, 2025
This PR also updates from v69-v71 as a side effect of
re-running mock generation.

This change extends the work done by @szesch based on
the PR commentary in migueleliasweb#81
trumant added a commit to trumant/go-github-mock that referenced this pull request May 1, 2025
This PR also updates from v69-v71 as a side effect of
re-running mock generation.

This change extends the work done by @szesch based on
the PR commentary in migueleliasweb#81
migueleliasweb pushed a commit that referenced this pull request May 4, 2025
This PR also updates from v69-v71 as a side effect of
re-running mock generation.

This change extends the work done by @szesch based on
the PR commentary in #81
@migueleliasweb
Copy link
Owner

@trumant and @szesch Are we good to close this PR since #82 was merged?

@trumant
Copy link
Contributor

trumant commented May 4, 2025

Need to re-test my use case but will do so in the next 48 hours and let you know

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants