mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 22:15:51 +01:00
Improve API compatibility for SourceTree and Drone.io (#2286)
This commit is contained in:
committed by
Naoki Takezoe
parent
f7defffeab
commit
841e6d110c
@@ -182,7 +182,8 @@ object ApiSpecModels {
|
||||
repository = repository,
|
||||
owner = apiUser,
|
||||
forkedCount = repositoryInfo.forkedCount,
|
||||
watchers = 0
|
||||
watchers = 0,
|
||||
permission = None
|
||||
)
|
||||
|
||||
val apiLabel = ApiLabel(
|
||||
@@ -409,6 +410,8 @@ object ApiSpecModels {
|
||||
assets = Seq(apiReleaseAsset)
|
||||
)
|
||||
|
||||
val apiEmail = ApiEmail("root@localhost", true)
|
||||
|
||||
// JSON String for APIs
|
||||
|
||||
val jsonUser = """{
|
||||
@@ -427,12 +430,15 @@ object ApiSpecModels {
|
||||
|"name":"Hello-World",
|
||||
|"full_name":"octocat/Hello-World",
|
||||
|"description":"This your first repo!",
|
||||
|"id":0,
|
||||
|"watchers":0,
|
||||
|"forks":1,
|
||||
|"private":false,
|
||||
|"fork":true,
|
||||
|"default_branch":"master",
|
||||
|"owner":$jsonUser,
|
||||
|"id":0,
|
||||
|"created_at":"2011-04-14T16:00:49Z",
|
||||
|"updated_at":"2011-04-14T16:00:49Z",
|
||||
|"forks_count":1,
|
||||
|"watchers_count":0,
|
||||
|"url":"http://gitbucket.exmple.com/api/v3/repos/octocat/Hello-World",
|
||||
@@ -687,4 +693,12 @@ object ApiSpecModels {
|
||||
|"author":${jsonUser},
|
||||
|"assets":[${jsonReleaseAsset}]
|
||||
|}""".stripMargin
|
||||
|
||||
val jsonEmail =
|
||||
s"""{
|
||||
|"email":"root@localhost",
|
||||
|"primary":true,
|
||||
|"verified":true,
|
||||
|"visibility":"public"
|
||||
|}""".stripMargin
|
||||
}
|
||||
|
||||
@@ -79,4 +79,7 @@ class JsonFormatSpec extends FunSuite {
|
||||
test("apiRelease") {
|
||||
assert(JsonFormat(apiRelease) == expected(jsonRelease))
|
||||
}
|
||||
test("apiEmail") {
|
||||
assert(JsonFormat(apiEmail) == expected(jsonEmail))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user