-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat(go): Add context support to all requests #1527
Conversation
✅ Deploy Preview for api-clients-automation ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
✗ The generated branch has been deleted.If the PR has been merged, you can check the generated code on the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
love it ! just a suggestion
@@ -70,12 +70,20 @@ func (c *APIClient) NewApi{{{nickname}}}Request({{#pathParams}} {{paramName}} {{ | |||
} | |||
} | |||
|
|||
// {{nickname}} wraps {{nickname}}WithContext using context.Background. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should you also add the description to this method ? I guess people will use this one first, I think it's okay to have duplicated doc in generated code, wdyt ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw this general convention on other popular packages. But your suggestion is also valid.
However, if you don't mind, is it okay to update these docs in another PR? Because, if you check you can see the actual method doesn't have a proper doc already. Most of them just say something like // @return AuthenticationCreateResponse
.
I already have a ticket in the backlog to generate proper doc comments for the API functions to guide users. I think this may belong there as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure if there is a ticket no problem !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gg !
Hey, can you wait for #1534 to be merged before merging this one pls ? Once a release PR is open we can't merge anything in between otherwise it breaks the release process |
no worries the process is a bit messy, it was just to let you know :) |
🧭 What and Why
🎟 JIRA Ticket: https://algolia.atlassian.net/browse/APIC-696
We need to provide a way to accept users' context while respecting general conventions in Go.
Changes included:
WithContext
suffix added for all API methods to comply with the general DX standards.Ex:
🧪 Test
Code generation and CI pipeline should be enough.