Skip to content

Commit

Permalink
fix response format of the sharees API
Browse files Browse the repository at this point in the history
  • Loading branch information
David Christofas committed Aug 4, 2021
1 parent a71d6bb commit 9dd8e7b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-sharees-api.md
Original file line number Diff line number Diff line change
@@ -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
14 changes: 7 additions & 7 deletions internal/http/services/owncloud/ocs/conversions/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down

0 comments on commit 9dd8e7b

Please sign in to comment.