diff --git a/pkg/resolvespec/handler.go b/pkg/resolvespec/handler.go index 45aeb70..fde0d11 100644 --- a/pkg/resolvespec/handler.go +++ b/pkg/resolvespec/handler.go @@ -73,7 +73,7 @@ func (h *Handler) getDefaultSort(schema, name string) []common.SortOption { if h.defaultSort == nil { return nil } - if sort, ok := h.defaultSort[defaultSortKey(schema, name)]; ok { + if sort := h.defaultSort[defaultSortKey(schema, name)]; len(sort) > 0 { return sort } return h.defaultSort[defaultSortKey("", "")] diff --git a/pkg/restheadspec/handler.go b/pkg/restheadspec/handler.go index 4d6c6e3..e213891 100644 --- a/pkg/restheadspec/handler.go +++ b/pkg/restheadspec/handler.go @@ -82,7 +82,7 @@ func (h *Handler) getDefaultSort(schema, name string) []common.SortOption { if h.defaultSort == nil { return nil } - if sort, ok := h.defaultSort[defaultSortKey(schema, name)]; ok { + if sort := h.defaultSort[defaultSortKey(schema, name)]; len(sort) > 0 { return sort } return h.defaultSort[defaultSortKey("", "")]