diff --git a/pkg/schema/factory.go b/pkg/schema/factory.go index 7c106b2..c06a727 100644 --- a/pkg/schema/factory.go +++ b/pkg/schema/factory.go @@ -96,8 +96,6 @@ func (c *Collection) schemasForSubject(access *accesscontrol.AccessSet) (*types. // always allow list s.CollectionMethods = append(s.CollectionMethods, http.MethodGet) } - } else { - continue } } @@ -118,6 +116,10 @@ func (c *Collection) schemasForSubject(access *accesscontrol.AccessSet) (*types. s.CollectionMethods = append(s.CollectionMethods, http.MethodPost) } + if len(s.CollectionMethods) == 0 && len(s.ResourceMethods) == 0 { + continue + } + if err := result.AddSchema(*s); err != nil { return nil, err }