swagger/fix: []string are not enum by swagger definition (#7916)

* []string are not enum by swagger definition

* apply suggestion of @guillep2k

* re-generate swagger file
pull/7989/head^2
Antoine GIRARD 5 years ago committed by GitHub
parent 042089fbaf
commit 954fe0e4e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      modules/structs/org_team.go
  2. 36
      templates/swagger/v1_json.tmpl

@ -13,7 +13,7 @@ type Team struct {
Organization *Organization `json:"organization"`
// enum: none,read,write,admin,owner
Permission string `json:"permission"`
// enum: repo.code,repo.issues,repo.ext_issues,repo.wiki,repo.pulls,repo.releases,repo.ext_wiki
// example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.ext_wiki"]
Units []string `json:"units"`
}
@ -24,7 +24,7 @@ type CreateTeamOption struct {
Description string `json:"description" binding:"MaxSize(255)"`
// enum: read,write,admin
Permission string `json:"permission"`
// enum: repo.code,repo.issues,repo.ext_issues,repo.wiki,repo.pulls,repo.releases,repo.ext_wiki
// example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.ext_wiki"]
Units []string `json:"units"`
}
@ -35,6 +35,6 @@ type EditTeamOption struct {
Description string `json:"description" binding:"MaxSize(255)"`
// enum: read,write,admin
Permission string `json:"permission"`
// enum: repo.code,repo.issues,repo.ext_issues,repo.wiki,repo.pulls,repo.releases,repo.ext_wiki
// example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.ext_wiki"]
Units []string `json:"units"`
}

@ -7742,7 +7742,11 @@
},
"units": {
"type": "array",
"enum": [
"items": {
"type": "string"
},
"x-go-name": "Units",
"example": [
"repo.code",
"repo.issues",
"repo.ext_issues",
@ -7750,11 +7754,7 @@
"repo.pulls",
"repo.releases",
"repo.ext_wiki"
],
"items": {
"type": "string"
},
"x-go-name": "Units"
]
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@ -8276,7 +8276,11 @@
},
"units": {
"type": "array",
"enum": [
"items": {
"type": "string"
},
"x-go-name": "Units",
"example": [
"repo.code",
"repo.issues",
"repo.ext_issues",
@ -8284,11 +8288,7 @@
"repo.pulls",
"repo.releases",
"repo.ext_wiki"
],
"items": {
"type": "string"
},
"x-go-name": "Units"
]
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"
@ -9827,7 +9827,11 @@
},
"units": {
"type": "array",
"enum": [
"items": {
"type": "string"
},
"x-go-name": "Units",
"example": [
"repo.code",
"repo.issues",
"repo.ext_issues",
@ -9835,11 +9839,7 @@
"repo.pulls",
"repo.releases",
"repo.ext_wiki"
],
"items": {
"type": "string"
},
"x-go-name": "Units"
]
}
},
"x-go-package": "code.gitea.io/gitea/modules/structs"

Loading…
Cancel
Save