From 9dd8e7bcf7424f4e624984ee587c9ebaf3977a95 Mon Sep 17 00:00:00 2001 From: David Christofas Date: Wed, 4 Aug 2021 16:32:33 +0200 Subject: [PATCH] fix response format of the sharees API --- changelog/unreleased/fix-sharees-api.md | 5 +++++ .../http/services/owncloud/ocs/conversions/main.go | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 changelog/unreleased/fix-sharees-api.md diff --git a/changelog/unreleased/fix-sharees-api.md b/changelog/unreleased/fix-sharees-api.md new file mode 100644 index 00000000000..b05f657866e --- /dev/null +++ b/changelog/unreleased/fix-sharees-api.md @@ -0,0 +1,5 @@ +Bugfix: Fix response format of the sharees API + +The sharees API wasn't returning the users and groups arrays correctly. + +https://github.com/cs3org/reva/pull/1954 diff --git a/internal/http/services/owncloud/ocs/conversions/main.go b/internal/http/services/owncloud/ocs/conversions/main.go index ffd714fdedf..0097f84b9b2 100644 --- a/internal/http/services/owncloud/ocs/conversions/main.go +++ b/internal/http/services/owncloud/ocs/conversions/main.go @@ -146,21 +146,21 @@ type ShareData struct { // ShareeData holds share recipient search results type ShareeData struct { Exact *ExactMatchesData `json:"exact" xml:"exact"` - Users []*MatchData `json:"users" xml:"users"` - Groups []*MatchData `json:"groups" xml:"groups"` - Remotes []*MatchData `json:"remotes" xml:"remotes"` + Users []*MatchData `json:"users" xml:"users>element"` + Groups []*MatchData `json:"groups" xml:"groups>element"` + Remotes []*MatchData `json:"remotes" xml:"remotes>element"` } // ExactMatchesData hold exact matches type ExactMatchesData struct { - Users []*MatchData `json:"users" xml:"users"` - Groups []*MatchData `json:"groups" xml:"groups"` - Remotes []*MatchData `json:"remotes" xml:"remotes"` + Users []*MatchData `json:"users" xml:"users>element"` + Groups []*MatchData `json:"groups" xml:"groups>element"` + Remotes []*MatchData `json:"remotes" xml:"remotes>element"` } // MatchData describes a single match type MatchData struct { - Label string `json:"label" xml:"label"` + Label string `json:"label" xml:"label,omitempty"` Value *MatchValueData `json:"value" xml:"value"` }