Skip to content

Go generate should validate and fix all documentation URLs #1476

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
gmlewis opened this issue Mar 28, 2020 · 0 comments · Fixed by #1477
Closed

Go generate should validate and fix all documentation URLs #1476

gmlewis opened this issue Mar 28, 2020 · 0 comments · Fixed by #1477
Assignees

Comments

@gmlewis
Copy link
Collaborator

gmlewis commented Mar 28, 2020

Here's a wild and wacky idea. that is certainly non-trivial to get right and not for the faint-of-heart nor is it good for someone who wants to get quick brownie points for contributing to an open source project. 😄 Edit: I decided to take it on myself.

After merging #1475, it dawned on me that URLs occasionally change in the GitHub v3 API documentation, and it would be amazing and beautiful if go generate ./... could go through and not only validate that all the URLs are correct (including the fragment identifier), but also fix them when they are not.

A URL is deemed correct only when it truly matches the endpoint in question (which is the difficult part of solving this issue, especially when "fixing" a broken one).

For example, this repo consistently (for the most part) generates a URL for the corresponding API endpoint, then shortly afterward makes an HTTP request using a particular "method" such as GET, PATCH, POST, PUT, and DELETE. I envision this tool to find the URL path and associated method, and then use this information to find the correct full URL in the GitHub v3 API documentation.

In my experience from maintaining and enhancing the Google Go API auto-generator, I'm betting that this tool may require the use of a whitelist and/or blacklist for overriding exceptional cases that would otherwise be challenging to determine.

I'm throwing out this issue for discussion or in case someone feels like they are up for a challenge and is as excited as I am about solving this issue. I have an idea how I would solve it, but will refrain for awhile and see if anyone else wants to take this on first. If nobody picks it up, I'll assign it to myself and work on it. Edit: I decided to take it on myself.

@gmlewis gmlewis added the challenging This issue is for experienced Go developers only, please. label Mar 28, 2020
@gmlewis gmlewis self-assigned this Mar 30, 2020
@gmlewis gmlewis removed the challenging This issue is for experienced Go developers only, please. label Mar 30, 2020
n1lesh pushed a commit to n1lesh/go-github that referenced this issue Oct 2, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant