Conversation
notehub/cmd/project.go
Outdated
| } | ||
|
|
||
| projectsRsp := ProjectsResponse{} | ||
| err := reqHubV1(GetVerbose(), GetAPIHub(), "GET", "/v1/projects", nil, &projectsRsp) |
There was a problem hiding this comment.
I think we should consider using the Notehub Golang SDK instead of essentially rewriting it by hand. It'll be a LOT less code and have better compile-time checks
There was a problem hiding this comment.
@scottfrazer I was planning on this but I believe it's private to the hub repo? I'm happy to change over to using it otherwise
There was a problem hiding this comment.
For example, instead of duplicating the Project and ProjectResponse objects and having to do the HTTP request, we could do:
projects, httpResp, err := sdk.ProjectAPI.
GetProjects(ctx).
Execute()This SDK is automatically generated from the OpenAPI spec
There was a problem hiding this comment.
Yes, it is private currently. We need to develop a process to publish it (like we for the JavaScript SDK). So far we haven't done it simply because there wasn't a specific need for it since we only use the SDK internally right now
But there's no reason why it shouldn't be public!
There was a problem hiding this comment.
Let me know when you have a mechanism to publish it, and I'll change over to use it! Looking forward to it!
No description provided.