The CreateHook method
|
func (s *RepositoriesService) CreateHook(ctx context.Context, owner, repo string, hook *Hook) (*Hook, *Response, error) { |
currently wants a Hook parameter that has Config of type map[string]interface{}
|
Config map[string]interface{} `json:"config,omitempty"` |
This forces the user to manually define each config properties.
My proposal is to change the Config to HookConfig, that for some reasons I'm not aware of is defined here:
|
type HookConfig struct { |
|
ContentType *string `json:"content_type,omitempty"` |
|
InsecureSSL *string `json:"insecure_ssl,omitempty"` |
|
URL *string `json:"url,omitempty"` |
|
|
|
// Secret is returned obfuscated by GitHub, but it can be set for outgoing requests. |
|
Secret *string `json:"secret,omitempty"` |
|
} |
This could be a breaking change for people currently using the CreateHook function (and every other functions taking Hook as input) so I am asking first how you want to proceed about it.
The
CreateHookmethodgo-github/github/repos_hooks.go
Line 85 in 6ca4d14
currently wants a
Hookparameter that hasConfigof typemap[string]interface{}go-github/github/repos_hooks.go
Line 54 in 6ca4d14
This forces the user to manually define each config properties.
My proposal is to change the
ConfigtoHookConfig, that for some reasons I'm not aware of is defined here:go-github/github/orgs_audit_log.go
Lines 24 to 31 in 6ca4d14
This could be a breaking change for people currently using the
CreateHookfunction (and every other functions takingHookas input) so I am asking first how you want to proceed about it.