Skip to content

Hook should contain Config of type HookConfig #3072

@himazawa

Description

@himazawa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking API ChangePR will require a bump to the major version num in next release. Look here to see the change(s).enhancementgood first issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions