Closed edwardofclt closed 2 years ago
Hi @edwardofclt ,
could you paste here the SDK method you're running?
I just noticed there is a possible improvement to the mock framework where the optional parameters are used to generate endpoints without them so the calls can succeed.
It appears, even the OpenApiSpec for the Github API says all parameters for the endpoint /repos/{owner}/{repo}/zipball/{ref}
are required but the description explains otherwise :disappointed: .
Even the go-github
SDK handles it in a weird way by appending the ref
if it's present. :disappointed:
See:
This seems to be an edge case.
No worries, I'm using the GetArchiveLink
method. I noticed the same thing in the go-github package. Thought it was odd.
@migueleliasweb about to sign off for the rest of the year - any tips on how to make this endpoint work?
I have an idea how to mitigate this but it will require some substantial changes to the internals of the way requests are configured in the mock server.
The main problem seems to be the expected HTTP status and header is quite specific for this endpoint.
I probably won't be able to have enough time to fix this today, I'm sorry.
If you have the time, feel free to raise a PR and I will be happy to review.
Hi @edwardofclt ,
I might have found a workaround. I took most of your example, so thank you. Can you try to use https://github.com/migueleliasweb/go-github-mock/pull/20 and see if it suits you?
Awesome! Thanks, I'll give it a go soon.
@edwardofclt Any updates on this?
I will be closing this for now.
Using the following logic (with a custom EndpointPattern because the already existing pattern assumes you're specifying a ref) I get an
Get "": unsupported protocol scheme ""
response.I'm unsure if what I'm doing is inherently wrong, but I believe I'm returning the same response that Github would return with the
http.StatusFound
response and with a header identifying the location of the requested zipball.Also, let me just say, I really appreciate this project - it's gotten me 95% of the way where I need to be for a project I'm working on. So, thank you!