swagger: document params

This commit is contained in:
André Roth
2024-11-28 17:16:08 +01:00
parent e5e3c49ace
commit d8b9777b40
3 changed files with 41 additions and 20 deletions

View File

@@ -13,10 +13,14 @@ import (
)
type gpgAddKeyParams struct {
Keyserver string
GpgKeyID string
GpgKeyArmor string
Keyring string
// Keyserver, when downloading GpgKeyIDs
Keyserver string `json:"Keyserver" example:"hkp://keyserver.ubuntu.com:80"`
// GpgKeyIDs to download from Keyserver, comma separated list
GpgKeyID string `json:"GpgKeyID" example:"EF0F382A1A7B6500,8B48AD6246925553"`
// Armored gpg public ket, instead of downloading from keyserver
GpgKeyArmor string `json:"GpgKeyArmor" example:""`
// Keyring for adding the keys (default: trustedkeys.gpg)
Keyring string `json:"Keyring" example:"trustedkeys.gpg"`
}
// @Summary Add GPG Keys

View File

@@ -165,10 +165,14 @@ func apiReposCreate(c *gin.Context) {
}
type reposEditParams struct {
Name *string
Comment *string
DefaultDistribution *string
DefaultComponent *string
// Name of repository to modify
Name *string `binding:"required" json:"Name" example:"repo1"`
// Change Comment of repository
Comment *string ` json:"Comment" example:"example repo"`
// Change Default Distribution for publishing
DefaultDistribution *string ` json:"DefaultDistribution" example:""`
// Change Devault Component for publishing
DefaultComponent *string ` json:"DefaultComponent" example:""`
}
// @Summary Update repo
@@ -332,7 +336,8 @@ func apiReposPackagesShow(c *gin.Context) {
}
type reposPackagesAddDeleteParams struct {
PackageRefs []string
// Package Refs
PackageRefs []string `binding:"required" json:"PackageRefs" example:""`
}
// Handler for both add and delete
@@ -593,8 +598,10 @@ func apiReposPackageFromDir(c *gin.Context) {
}
type reposCopyPackageParams struct {
// Copy also dependencies
WithDeps bool `json:"with-deps,omitempty"`
DryRun bool `json:"dry-run,omitempty"`
// Do not perform operations
DryRun bool `json:"dry-run,omitempty"`
}
// @Summary Copy Package

View File

@@ -42,8 +42,10 @@ func apiSnapshotsList(c *gin.Context) {
}
type snapshotsCreateFromMirrorParams struct {
Name string `binding:"required"`
Description string
// Name of snapshot to create
Name string `binding:"required" json:"Name" example:"snap1"`
// Description of snapshot
Description string ` json:"Description"`
}
// @Summary Snapshot Mirror
@@ -114,10 +116,14 @@ func apiSnapshotsCreateFromMirror(c *gin.Context) {
}
type snapshotsCreateParams struct {
Name string `binding:"required"`
Description string
SourceSnapshots []string
PackageRefs []string
// Name of snapshot to create
Name string `binding:"required" json:"Name" example:"snap2"`
// Description of snapshot
Description string ` json:"Description"`
// List of source snapshots
SourceSnapshots []string `binding:"required" json:"SourceSnapshots" example:"snap1"`
// List of package refs
PackageRefs []string `binding:"required" json:"PackageRefs" example:""`
}
// @Summary Snapshot Packages
@@ -202,8 +208,10 @@ func apiSnapshotsCreate(c *gin.Context) {
}
type snapshotsCreateFromRepositoryParams struct {
Name string `binding:"required"`
Description string
// Name of snapshot to create
Name string `binding:"required" json:"Name" example:"snap1"`
// Description of snapshot
Description string ` json:"Description"`
}
// @Summary Snapshot Repository
@@ -270,8 +278,10 @@ func apiSnapshotsCreateFromRepository(c *gin.Context) {
}
type snapshotsUpdateParams struct {
Name string
Description string
// Change Name of snapshot
Name string `binding:"required" json:"Name" example:"snap2"`
// Change Description of snapshot
Description string ` json:"Description"`
}
// @Summary Update Snapshot