Skip to content

Commit

Permalink
fix capabilities decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
2403905 committed Nov 8, 2023
1 parent acbd11b commit 6761ac6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/fix-capabilities.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Bugfix: Fix capabilities decoding

We have fixed a bug when the mapstructure is not able to decode in to the embedded structure

https://github.com/cs3org/reva/pull/4324
25 changes: 10 additions & 15 deletions internal/http/services/owncloud/ocs/data/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,25 +69,20 @@ type CapabilitiesSearch struct {

// CapabilitiesSearchProperties holds the search property capabilities
type CapabilitiesSearchProperties struct {
Name *CapabilitiesSearchProperty `json:"name" xml:"name" mapstructure:"name"`
Mtime *CapabilitiesSearchPropertyExtended `json:"mtime" xml:"mtime" mapstructure:"mtime"`
Size *CapabilitiesSearchProperty `json:"size" xml:"size" mapstructure:"size"`
Mimetype *CapabilitiesSearchPropertyExtended `json:"mimetype" xml:"mimetype" mapstructure:"mimetype"`
Type *CapabilitiesSearchProperty `json:"type" xml:"type" mapstructure:"type"`
Tag *CapabilitiesSearchProperty `json:"tag" xml:"tag" mapstructure:"tag"`
Tags *CapabilitiesSearchProperty `json:"tags" xml:"tags" mapstructure:"tags"`
Content *CapabilitiesSearchProperty `json:"content" xml:"content" mapstructure:"content"`
Scope *CapabilitiesSearchProperty `json:"scope" xml:"scope" mapstructure:"scope"`
Name *CapabilitiesSearchProperty `json:"name" xml:"name" mapstructure:"name"`
Mtime *CapabilitiesSearchProperty `json:"mtime" xml:"mtime" mapstructure:"mtime"`
Size *CapabilitiesSearchProperty `json:"size" xml:"size" mapstructure:"size"`
Mimetype *CapabilitiesSearchProperty `json:"mimetype" xml:"mimetype" mapstructure:"mimetype"`
Type *CapabilitiesSearchProperty `json:"type" xml:"type" mapstructure:"type"`
Tag *CapabilitiesSearchProperty `json:"tag" xml:"tag" mapstructure:"tag"`
Tags *CapabilitiesSearchProperty `json:"tags" xml:"tags" mapstructure:"tags"`
Content *CapabilitiesSearchProperty `json:"content" xml:"content" mapstructure:"content"`
Scope *CapabilitiesSearchProperty `json:"scope" xml:"scope" mapstructure:"scope"`
}

// CapabilitiesSearchProperty represents the default search property
type CapabilitiesSearchProperty struct {
Enabled bool `json:"enabled" xml:"enabled" mapstructure:"enabled"`
}

// CapabilitiesSearchPropertyExtended represents the extended search property
type CapabilitiesSearchPropertyExtended struct {
CapabilitiesSearchProperty
Enabled bool `json:"enabled" xml:"enabled" mapstructure:"enabled"`
Keywords []string `json:"keywords,omitempty" xml:"keywords,omitempty" mapstructure:"keywords"`
}

Expand Down

0 comments on commit 6761ac6

Please sign in to comment.