You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
so not a list of links, that would make things harder in the frontend
this also saves a lot on request times, certainly when a lot of repositories will be linked (HTTP2 is a thing but a lot of requests will take quit a significant time)
Error handling
When an error occurs, it should be displayed in a proper way in the frontend.
I would suggest the following format:
// A general error returns errors that are not linked to any input field.
generalErrors: [{message: "Something general has occurred."}],// A field error returns an error that is linked to a body input field. // (eg name or description when creating a project)inputErrors: [{input: "name",message: "Name cannot be longer than 3 characters."}]
The text was updated successfully, but these errors were encountered:
👍 Maybe it would be an idea to maintain an OpenAPI spec, for maximal clarity? This would also be helpful when developing integrations with g2 later on.
+1 Maybe it would be an idea to maintain an OpenAPI spec, for maximal clarity? This would also be helpful when developing integrations with g2 later on.
There is already an OpenAPI (Swagger) spec available at the root :)
I would propose following changes that would allow the frontend for easier and cleaner development.
Endpoint changes
Projects
GET /projects
POST /projects
GET /projects/:id
DELETE /projects/:id
PATCH /projects/:id
GET /projects/:id/repositories
GET /projects/:id/issues
GET /projects/:id/pullrequests
Repositories
GET /repositories
GET /repositories/:id
POST /repositories/:id/link/:projectId
POST /repositories/:id/unlink/:projectId
POST /repositories/sync
In essence
"repo": [],
but rather[]
name_id
->id
for every endpoint.repos: [10, 11]
->repositories: "https://url/projects/2/repositories"
Error handling
When an error occurs, it should be displayed in a proper way in the frontend.
I would suggest the following format:
The text was updated successfully, but these errors were encountered: