From e8055904e10eaecc5cbba0bd2bbd9725235ec7d6 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Fri, 12 Apr 2024 14:10:27 +0200 Subject: [PATCH] swagger fix infinitive recursion on some types Commit 668d517af9 moved a lot of type definitions and by that also copied a bucnh of swagger:model comments, this caused swagger to create a incorrect yaml that can no longer be parsed by redoc due "Self-referencing circular pointer". The yaml basically defined the type with a name and the pointed to the same name definition again so it caused a infinitive recursion where redoc just throws an error but the swagger style ignored the case so it seemed like it worked but obviously the type information was not working. Fixes #22351 Signed-off-by: Paul Holzinger --- pkg/domain/entities/images.go | 1 - pkg/domain/entities/manifest.go | 6 ------ pkg/domain/entities/network.go | 1 - pkg/domain/entities/system.go | 1 - pkg/domain/entities/types/auth.go | 1 + pkg/domain/entities/volumes.go | 1 - 6 files changed, 1 insertion(+), 10 deletions(-) diff --git a/pkg/domain/entities/images.go b/pkg/domain/entities/images.go index 1a9b8a6678..9b3a40eb71 100644 --- a/pkg/domain/entities/images.go +++ b/pkg/domain/entities/images.go @@ -51,7 +51,6 @@ func (i *Image) Id() string { //nolint:revive,stylecheck return i.ID } -// swagger:model LibpodImageSummary type ImageSummary = entitiesTypes.ImageSummary // ImageRemoveOptions can be used to alter image removal. diff --git a/pkg/domain/entities/manifest.go b/pkg/domain/entities/manifest.go index 7e2a5c46de..a81e76c076 100644 --- a/pkg/domain/entities/manifest.go +++ b/pkg/domain/entities/manifest.go @@ -117,8 +117,6 @@ type ManifestModifyOptions struct { } // ManifestPushReport provides the model for the pushed manifest -// -// swagger:model type ManifestPushReport = entitiesTypes.ManifestPushReport // ManifestRemoveOptions provides the model for removing digests from a manifest @@ -128,11 +126,7 @@ type ManifestRemoveOptions struct { } // ManifestRemoveReport provides the model for the removed manifest -// -// swagger:model type ManifestRemoveReport = entitiesTypes.ManifestRemoveReport // ManifestModifyReport provides the model for removed digests and changed manifest -// -// swagger:model type ManifestModifyReport = entitiesTypes.ManifestModifyReport diff --git a/pkg/domain/entities/network.go b/pkg/domain/entities/network.go index 1edc335c3b..74b6af5c83 100644 --- a/pkg/domain/entities/network.go +++ b/pkg/domain/entities/network.go @@ -75,7 +75,6 @@ type NetworkConnectOptions = entitiesTypes.NetworkConnectOptions // NetworkPruneReport containers the name of network and an error // associated in its pruning (removal) -// swagger:model NetworkPruneReport type NetworkPruneReport = entitiesTypes.NetworkPruneReport // NetworkPruneOptions describes options for pruning unused networks diff --git a/pkg/domain/entities/system.go b/pkg/domain/entities/system.go index 5d11f0a326..e62214e7c4 100644 --- a/pkg/domain/entities/system.go +++ b/pkg/domain/entities/system.go @@ -19,7 +19,6 @@ type SystemUnshareOptions = types.SystemUnshareOptions type ComponentVersion = types.SystemComponentVersion type ListRegistriesReport = types.ListRegistriesReport -// swagger:model AuthConfig type AuthConfig = types.AuthConfig type AuthReport = types.AuthReport type LocksReport = types.LocksReport diff --git a/pkg/domain/entities/types/auth.go b/pkg/domain/entities/types/auth.go index 7f2480173f..3fa66987a1 100644 --- a/pkg/domain/entities/types/auth.go +++ b/pkg/domain/entities/types/auth.go @@ -2,6 +2,7 @@ package types // AuthConfig contains authorization information for connecting to a Registry +// swagger:model type AuthConfig struct { Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` diff --git a/pkg/domain/entities/volumes.go b/pkg/domain/entities/volumes.go index a0acd3a7f0..050e28ce0c 100644 --- a/pkg/domain/entities/volumes.go +++ b/pkg/domain/entities/volumes.go @@ -7,7 +7,6 @@ import ( ) // VolumeCreateOptions provides details for creating volumes -// swagger:model type VolumeCreateOptions = types.VolumeCreateOptions type VolumeConfigResponse = types.VolumeConfigResponse