-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Use /orgs instead of /org to match GitHub v3 API #2639
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2639 +/- ##
==========================================
+ Coverage 27.11% 27.12% +0.01%
==========================================
Files 86 86
Lines 17064 17064
==========================================
+ Hits 4627 4629 +2
+ Misses 11759 11757 -2
Partials 678 678
Continue to review full report at Codecov.
|
@@ -173,7 +173,7 @@ func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) { | |||
// 403: forbidden | |||
// 500: error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to update the swagger:route (the url part) also. You can even edit {org} since in url params in swagger are not yet configured.
The cherry on the cake would be to keep the old url available and mark it as deprecated in swagger.
|
But you're doing this under the |
I agree with @strk that v1 route should be left as it is and note added in swagger docs that it is deprecated and new one should be created under v3 that would be with GitHub compatible route |
@raphink no currently there is no such route. But you can add it ;) |
routers/api/v1/repo/repo.go
Outdated
@@ -159,7 +159,7 @@ func Create(ctx *context.APIContext, opt api.CreateRepoOption) { | |||
|
|||
// CreateOrgRepo create one repository of the organization | |||
func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) { | |||
// swagger:route POST /org/{org}/repos organization createOrgRepo | |||
// swagger:route POST /org/{orgname}/repos organization createOrgRepo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/orgs/{orgname}/repos
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this PR needs the BREAKING label since it changes the API urls.
@JonasFranzDEV that's why I think this should be done as new /v3 route and current marked as deprecated not to break existing API |
Didn't we say that a new endpoint should have been added ( |
Since we're not compatible with |
Currently, my issue is to be able to use the Terraform github provider with gitea, which is currently not possible when creating repositories (due to that difference in paths). |
@bkc why coulnd't we just put partial support /v3/ while it's being
implemented ? As long as the /v2 still works ?
|
Put the routers to |
I guess implementing |
Or keep both routers for compatibility since there are no conflicts between them. |
Wasn't against that suggestion. We should keep both and after |
The current API uses |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 months. Thank you for your contributions. |
Closing per above discussion. Once we get a /v3/ route for API that is compatible with GitHub, then we can re-open this PR. Thanks for contribution. |
As per https://developer.github.com/v3/repos/#create