Skip to content

Commit

Permalink
Make optional params from 2946 optionals
Browse files Browse the repository at this point in the history
Add the `omitempty` annotation to `MSC2946SpacesRequest.ExcludeRooms` and `MSC2946SpacesRequest.MaxRoomsPerSpace` as MSC2946 states these are optional parameters (and keeping them around with their zero value might lead to type errors when interacting with other homeservers). See matrix-org/synapse#10056 for more context.
  • Loading branch information
babolivier authored May 25, 2021
1 parent 124228c commit b57849b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions federationtypes.go
Original file line number Diff line number Diff line change
Expand Up @@ -977,8 +977,8 @@ func (r *MSC2836EventRelationshipsResponse) UnmarshalJSON(data []byte) error {
// MSC2946SpacesRequest is the HTTP body for the federated /unstable/spaces/{roomID} endpoint
// See https://github.com/matrix-org/matrix-doc/pull/2946
type MSC2946SpacesRequest struct {
ExcludeRooms []string `json:"exclude_rooms"`
MaxRoomsPerSpace int `json:"max_rooms_per_space"`
ExcludeRooms []string `json:"exclude_rooms,omitempty"`
MaxRoomsPerSpace int `json:"max_rooms_per_space,omitempty"`
Limit int `json:"limit"`
Batch string `json:"batch"`
}
Expand Down

0 comments on commit b57849b

Please sign in to comment.