fix optional params

This commit is contained in:
André Roth
2024-11-29 17:38:12 +01:00
parent d8b9777b40
commit 1f469e23b5
2 changed files with 7 additions and 7 deletions
+6 -6
View File
@@ -117,13 +117,13 @@ func apiSnapshotsCreateFromMirror(c *gin.Context) {
type snapshotsCreateParams struct { type snapshotsCreateParams struct {
// Name of snapshot to create // Name of snapshot to create
Name string `binding:"required" json:"Name" example:"snap2"` Name string `binding:"required" json:"Name" example:"snap2"`
// Description of snapshot // Description of snapshot
Description string ` json:"Description"` Description string ` json:"Description"`
// List of source snapshots // List of source snapshots
SourceSnapshots []string `binding:"required" json:"SourceSnapshots" example:"snap1"` SourceSnapshots []string ` json:"SourceSnapshots" example:"snap1"`
// List of package refs // List of package refs
PackageRefs []string `binding:"required" json:"PackageRefs" example:""` PackageRefs []string ` json:"PackageRefs" example:""`
} }
// @Summary Snapshot Packages // @Summary Snapshot Packages
@@ -279,9 +279,9 @@ func apiSnapshotsCreateFromRepository(c *gin.Context) {
type snapshotsUpdateParams struct { type snapshotsUpdateParams struct {
// Change Name of snapshot // Change Name of snapshot
Name string `binding:"required" json:"Name" example:"snap2"` Name string ` json:"Name" example:"snap2"`
// Change Description of snapshot // Change Description of snapshot
Description string ` json:"Description"` Description string `json:"Description"`
} }
// @Summary Update Snapshot // @Summary Update Snapshot
+1 -1
View File
@@ -84,7 +84,7 @@ class APITest(BaseTest):
self._ensure_async(kwargs) self._ensure_async(kwargs)
resp = self.post(uri, *args, **kwargs) resp = self.post(uri, *args, **kwargs)
if resp.status_code != 202: if resp.status_code != 202:
return resp raise Exception("async api error: " + resp.text)
_id = resp.json()['ID'] _id = resp.json()['ID']
resp = self.get("/api/tasks/" + str(_id) + "/wait") resp = self.get("/api/tasks/" + str(_id) + "/wait")