From d02ba5147257af331140532e125ddba203e64a6a Mon Sep 17 00:00:00 2001 From: Roman Perekhod Date: Wed, 8 Nov 2023 19:17:33 +0100 Subject: [PATCH] fix capabilities decoding --- changelog/unreleased/fix-capabilities.md | 5 +++++ internal/http/services/owncloud/ocs/data/capabilities.go | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 changelog/unreleased/fix-capabilities.md diff --git a/changelog/unreleased/fix-capabilities.md b/changelog/unreleased/fix-capabilities.md new file mode 100644 index 0000000000..c538c9e8f5 --- /dev/null +++ b/changelog/unreleased/fix-capabilities.md @@ -0,0 +1,5 @@ +Bugfix: Fix capabilities decoding + +We have fixed a bug when the mapstructure is ignored the embedded structure when decode + +https://github.com/cs3org/reva/pull/4324 diff --git a/internal/http/services/owncloud/ocs/data/capabilities.go b/internal/http/services/owncloud/ocs/data/capabilities.go index 7718d2b2a0..5cb153face 100644 --- a/internal/http/services/owncloud/ocs/data/capabilities.go +++ b/internal/http/services/owncloud/ocs/data/capabilities.go @@ -82,13 +82,13 @@ type CapabilitiesSearchProperties struct { // CapabilitiesSearchProperty represents the default search property type CapabilitiesSearchProperty struct { - Enabled bool `json:"enabled" xml:"enabled" mapstructure:"enabled"` + Enabled ocsBool `json:"enabled" xml:"enabled" mapstructure:"enabled"` } // CapabilitiesSearchPropertyExtended represents the extended search property type CapabilitiesSearchPropertyExtended struct { - CapabilitiesSearchProperty - Keywords []string `json:"keywords,omitempty" xml:"keywords,omitempty" mapstructure:"keywords"` + CapabilitiesSearchProperty `mapstructure:",squash"` + Keywords []string `json:"keywords,omitempty" xml:"keywords,omitempty" mapstructure:"keywords"` } // Spaces lets a service configure its advertised options related to Storage Spaces.