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

(Another) heads up: stricter validation coming soon in the create repo for org endpoint #1014

Closed
kytrinyx opened this issue Sep 23, 2018 · 3 comments
Assignees

Comments

@kytrinyx
Copy link
Contributor

A few weeks back we discussed an issue where the GitHub API is going to return 422s when incorrect parameters are passed (rather than just ignoring those parameters): #992

We found another instance where we get incorrect parameters with the google/go-github header.

Our current plan is to turn on stricter validation on November 1st (we were going to do this earlier, but we've been seeing a lot of mismatches across the board, and are doing some work to let everyone know first!).

The Create a repository for an organization endpoint doesn't take an archived parameter, but we're seeing archived being passed to a number of endpoints.

Would you have a chance to look into whether this is encoded into the library itself, or whether it might be user error?

@gmlewis
Copy link
Collaborator

gmlewis commented Sep 23, 2018

This is the same situation as #992: the user can pass in a full Repository struct which contains the archived field, and our documentation says:

	// Additional mutable fields when creating and editing a repository
...
	Archived          *bool   `json:"archived,omitempty"`

which makes it sound like this is a valid field.

Here is the code:
https://github.com/google/go-github/blob/master/github/repos.go#L262-L287

I think this could be handled the same way as #997.

@kytrinyx
Copy link
Contributor Author

I think this could be handled the same way as #997.

After having read through the discussions and code changes, I think you're right.

@gmlewis
Copy link
Collaborator

gmlewis commented Sep 25, 2018

I will let this sit possibly for a little while... although I'm tempted to just go in and fix it... but if a new Go developer or new contributor to this repo wants to take it, please comment and it is yours. (I've been accused of "nibbling the cookies" and robbing others of the opportunity to contribute in the past, so I'm trying not to do that. 😄)

Please read our CONTRIBUTING.md file for helpful information on contributing to this repo.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants