Browse Source

Fix ListWorkflowRuns OpenAPI response model. (#35026)

Change the OpenAPI response of `ListWorkflowRuns` to `WorkflowRunsList`
like it is supposed to be.

---------

Signed-off-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
pull/35031/head
Scion 5 months ago committed by GitHub
parent
commit
af0196c145
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      modules/structs/repo.go
  2. 2
      routers/api/v1/repo/action.go
  3. 2
      services/convert/repository.go
  4. 2
      templates/swagger/v1_json.tmpl

4
modules/structs/repo.go

@ -57,7 +57,7 @@ type Repository struct { @@ -57,7 +57,7 @@ type Repository struct {
Private bool `json:"private"`
Fork bool `json:"fork"`
Template bool `json:"template"`
Parent *Repository `json:"parent"`
Parent *Repository `json:"parent,omitempty"`
Mirror bool `json:"mirror"`
Size int `json:"size"`
Language string `json:"language"`
@ -114,7 +114,7 @@ type Repository struct { @@ -114,7 +114,7 @@ type Repository struct {
ObjectFormatName string `json:"object_format_name"`
// swagger:strfmt date-time
MirrorUpdated time.Time `json:"mirror_updated"`
RepoTransfer *RepoTransfer `json:"repo_transfer"`
RepoTransfer *RepoTransfer `json:"repo_transfer,omitempty"`
Topics []string `json:"topics"`
Licenses []string `json:"licenses"`
}

2
routers/api/v1/repo/action.go

@ -747,7 +747,7 @@ func (Action) ListWorkflowRuns(ctx *context.APIContext) { @@ -747,7 +747,7 @@ func (Action) ListWorkflowRuns(ctx *context.APIContext) {
// type: integer
// responses:
// "200":
// "$ref": "#/responses/ArtifactsList"
// "$ref": "#/responses/WorkflowRunsList"
// "400":
// "$ref": "#/responses/error"
// "404":

2
services/convert/repository.go

@ -251,7 +251,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, permissionInR @@ -251,7 +251,7 @@ func innerToRepo(ctx context.Context, repo *repo_model.Repository, permissionInR
RepoTransfer: transfer,
Topics: util.SliceNilAsEmpty(repo.Topics),
ObjectFormatName: repo.ObjectFormatName,
Licenses: repoLicenses.StringList(),
Licenses: util.SliceNilAsEmpty(repoLicenses.StringList()),
}
}

2
templates/swagger/v1_json.tmpl generated

@ -5165,7 +5165,7 @@ @@ -5165,7 +5165,7 @@
],
"responses": {
"200": {
"$ref": "#/responses/ArtifactsList"
"$ref": "#/responses/WorkflowRunsList"
},
"400": {
"$ref": "#/responses/error"

Loading…
Cancel
Save