-
Notifications
You must be signed in to change notification settings - Fork 156
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
Helper to construct REST endpoints #821
Comments
Another idea is to have this part of the rest function octo.nvim/lua/octo/gh/init.lua Lines 300 to 339 in d514e01
For example, another parameter in Then the API becomes: local gh = require "octo.gh"
local endpoint = "/repos/{owner}/{repo}/notifications"
gh.api.get {
endpoint,
format = {
owner = "pwntester",
repo = "octo.nvim"
},
} And the user doesn't think about string interpolation at all. Thoughts on this? @ldelossa |
I like it! It could be handy to have "prebaked" "get", "post", etc... handlers with a simple syntax. Im assuming that a callback can be provided to the "get" function as well? |
No formatting would likely be default behavior. The way it is set up now allows for all gh.run parameters in the opts parameters. Others are dynamically generated See here for reference: #876 The only change is "params" or "format" would be a designated parameter to format any endpoint placeholders |
Some ideas for the API:
Related to #751
The text was updated successfully, but these errors were encountered: