Skip to content

Commit f65f4c9

Browse files
committed
Fix openapi spec for cozystack apps
Signed-off-by: Andrei Kvapil <[email protected]>
1 parent b08a5d3 commit f65f4c9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pkg/cmd/server/start.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -202,21 +202,21 @@ func (o *AppsServerOptions) Config() (*apiserver.Config, error) {
202202
defs := swagger.Definitions
203203

204204
// Verify the presence of the base Application/ApplicationList definitions
205-
appDef, exists := defs["com.github.aenix.io.cozystack.pkg.apis.apps.v1alpha1.Application"]
205+
appDef, exists := defs["com.github.aenix-io.cozystack.pkg.apis.apps.v1alpha1.Application"]
206206
if !exists {
207207
return swagger, fmt.Errorf("Application definition not found")
208208
}
209209

210-
listDef, exists := defs["com.github.aenix.io.cozystack.pkg.apis.apps.v1alpha1.ApplicationList"]
210+
listDef, exists := defs["com.github.aenix-io.cozystack.pkg.apis.apps.v1alpha1.ApplicationList"]
211211
if !exists {
212212
return swagger, fmt.Errorf("ApplicationList definition not found")
213213
}
214214

215215
// Iterate over all registered GVKs (e.g., Bucket, Database, etc.)
216216
for _, gvk := range v1alpha1.RegisteredGVKs {
217217
// This will be something like:
218-
// "com.github.aenix.io.cozystack.pkg.apis.apps.v1alpha1.Bucket"
219-
resourceName := fmt.Sprintf("com.github.aenix.io.cozystack.pkg.apis.apps.v1alpha1.%s", gvk.Kind)
218+
// "com.github.aenix-io.cozystack.pkg.apis.apps.v1alpha1.Bucket"
219+
resourceName := fmt.Sprintf("com.github.aenix-io.cozystack.pkg.apis.apps.v1alpha1.%s", gvk.Kind)
220220

221221
// 1. Create a copy of the base Application definition for the new resource
222222
newDef, err := DeepCopySchema(&appDef)
@@ -242,7 +242,7 @@ func (o *AppsServerOptions) Config() (*apiserver.Config, error) {
242242

243243
// 4. Now handle the corresponding List type (e.g., BucketList).
244244
// We'll start by copying the ApplicationList definition.
245-
listResourceName := fmt.Sprintf("com.github.aenix.io.cozystack.pkg.apis.apps.v1alpha1.%sList", gvk.Kind)
245+
listResourceName := fmt.Sprintf("com.github.aenix-io.cozystack.pkg.apis.apps.v1alpha1.%sList", gvk.Kind)
246246
newListDef, err := DeepCopySchema(&listDef)
247247
if err != nil {
248248
return nil, fmt.Errorf("failed to deepcopy schema for %sList: %w", gvk.Kind, err)
@@ -275,8 +275,8 @@ func (o *AppsServerOptions) Config() (*apiserver.Config, error) {
275275
}
276276

277277
// Remove the original Application/ApplicationList from the definitions
278-
delete(defs, "com.github.aenix.io.cozystack.pkg.apis.apps.v1alpha1.Application")
279-
delete(defs, "com.github.aenix.io.cozystack.pkg.apis.apps.v1alpha1.ApplicationList")
278+
delete(defs, "com.github.aenix-io.cozystack.pkg.apis.apps.v1alpha1.Application")
279+
delete(defs, "com.github.aenix-io.cozystack.pkg.apis.apps.v1alpha1.ApplicationList")
280280

281281
swagger.Definitions = defs
282282
return swagger, nil

0 commit comments

Comments
 (0)