You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
David Svantesson 1f951cdeba Add API endpoint for accessing repo topics (#7963)
* Create API endpoints for repo topics.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Generate swagger

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add documentation to functions

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Grammar fix

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix function comment

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Can't use FindTopics when looking for a single repo topic, as it doesnt use exact match

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add PUT ​/repos​/{owner}​/{repo}​/topics and remove GET ​/repos​/{owner}​/{repo}​/topics

* Ignore if topic is sent twice in same request, refactoring.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix topic dropdown with api changes.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Style fix

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Update API documentation

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Better way to handle duplicate topics in slice

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Make response element TopicName an array of strings, instead of using an array of TopicName

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add test cases for API Repo Topics.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix format of tests

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix comments

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix unit tests after adding some more topics to the test fixture.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Update models/topic.go

Limit multiple if else if ...

Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>

* Engine as first parameter in function

Co-Authored-By: Antoine GIRARD <sapk@users.noreply.github.com>

* Replace magic numbers with http status code constants.

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix variable scope

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Test one read with login and one with token

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Add some more tests

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Apply suggestions from code review

Use empty struct for efficiency

Co-Authored-By: Lauris BH <lauris@nix.lv>

* Add test case to check access for user with write access

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Fix access, repo admin required to change topics

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Correct first test to be without token

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>

* Any repo reader should be able to access topics.

* No need for string pointer

Signed-off-by: David Svantesson <davidsvantesson@gmail.com>
5 years ago
..
blob.go Fixes 4762 - Content API for Creating, Updating, Deleting Files (#6314) 5 years ago
branch.go Use gitea forked macaron (#7933) 5 years ago
collaborators.go Use gitea forked macaron (#7933) 5 years ago
commits.go API method to list all commits of a repository (#6408) 5 years ago
file.go Fixes #7292 - API File Contents bug (#7301) 5 years ago
fork.go Use gitea forked macaron (#7933) 5 years ago
git_hook.go Move sdk structs to modules/structs (#6905) 5 years ago
git_ref.go api: fix multiple bugs with statuses endpoints (#7785) 5 years ago
hook.go fix wrong email when use gitea as OAuth2 provider (#7640) 5 years ago
hook_test.go API endpoint for testing webhook (#3550) 6 years ago
issue.go Use gitea forked macaron (#7933) 5 years ago
issue_comment.go Use gitea forked macaron (#7933) 5 years ago
issue_label.go Use gitea forked macaron (#7933) 5 years ago
issue_tracked_time.go Use gitea forked macaron (#7933) 5 years ago
key.go Use gitea forked macaron (#7933) 5 years ago
label.go Use gitea forked macaron (#7933) 5 years ago
main_test.go API endpoint for testing webhook (#3550) 6 years ago
milestone.go Display ui time with customize time location (#7792) 5 years ago
pull.go Retry create issue to cope with duplicate keys (#7898) 5 years ago
release.go Use gitea forked macaron (#7933) 5 years ago
release_attachment.go Use gitea forked macaron (#7933) 5 years ago
repo.go Add API endpoint for accessing repo topics (#7963) 5 years ago
repo_test.go Fixes #5960 - Adds API Endpoint for Repo Edit (#7006) 5 years ago
star.go Use gitea forked macaron (#7933) 5 years ago
status.go Use gitea forked macaron (#7933) 5 years ago
subscriber.go Use gitea forked macaron (#7933) 5 years ago
tag.go Adds details about what tags can use the Git tags API (#7989) 5 years ago
topic.go Add API endpoint for accessing repo topics (#7963) 5 years ago
tree.go Fixes 4762 - Content API for Creating, Updating, Deleting Files (#6314) 5 years ago