Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix json wrapping in object response #1004

Merged
merged 2 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ type (
Object struct {
Metadata ObjectUserMetadata `json:"metadata,omitempty"`
ObjectMetadata
*object.Object `json:"omitempty"`
*object.Object
}

// ObjectMetadata contains various metadata about an object.
Expand Down
7 changes: 5 additions & 2 deletions object/object.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,12 @@ func GenerateEncryptionKey() EncryptionKey {
}

// An Object is a unit of data that has been stored on a host.
// NOTE: Object is embedded in the API's Object type, so all fields should be
// tagged omitempty to make sure responses where no object is returned remain
// clean.
type Object struct {
Key EncryptionKey `json:"key"`
Slabs []SlabSlice `json:"slabs"`
Key EncryptionKey `json:"key,omitempty"`
ChrisSchinnerl marked this conversation as resolved.
Show resolved Hide resolved
Slabs []SlabSlice `json:"slabs,omitempty"`
}

// NewObject returns a new Object with a random key.
Expand Down
Loading