-
Notifications
You must be signed in to change notification settings - Fork 1
Silences: Use PostableSilence as the base struct for creating silences #38
Conversation
@@ -93,7 +93,7 @@ import ( | |||
// swagger:parameters RouteCreateSilence | |||
type CreateSilenceParams struct { | |||
// in:body |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Upstream uses the same nomenclature but unsure whenever we've deliberately changed it or this was unintended.
/ swagger:parameters postSilences
type PostSilencesParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
/*The silence to create
Required: true
In: body
*/
Silence *models.PostableSilence
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it was deliberately changed. @domasx2 can you confirm?
type PostableSilence = amv2.PostableSilence | ||
|
||
// swagger:model | ||
type GettableSilences = amv2.GettableSilences |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From a brief research, I was unsure whenever there would be any downsides of using type aliasing vs struct embedding. In this case, I don't want to add any extra methods so I went with the former. Happy to listed to opinions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have preference, if aliasing works better for encoding/decoding purposes let's keep that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, you have to push also the modifications in spec.json and post.json
type PostableSilence = amv2.PostableSilence | ||
|
||
// swagger:model | ||
type GettableSilences = amv2.GettableSilences |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have preference, if aliasing works better for encoding/decoding purposes let's keep that.
No description provided.