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
Currently to have fine-grained problem responses we have a lot of functions/methods with the suffix "-WritesProblem" and then returns true if they succeeded or false if they failed and wrote a problem to the gin context.
This would need us to add "NewProblem..." functions to the wharf-core/pkg/ginutil package, and a utility function that wrotes a returned problem response to the HTTP response, or converts a non-problem response to a problem response and then writes that instead to the HTTP response.
This way we could offload a lot of work from the endpoint methods by only using return values. Maybe we could wrap the functions as well so instead of being func(*gin.Context) to be func(*gin.Context) error where it uses that error->problem.Response that I mentioned in the above paragraph.
Just a thought. Could need an RFC to show both the wharf-core changes as well as the changes to the API repos as this would involve a lot of work and the specific implementation needs a good overview.
The text was updated successfully, but these errors were encountered:
applejag
added
chore
Routine task, refactoring, or other changes not affecting end-users directly.
prio/2
Medium priority. "Good to have"
and removed
enhancement
New feature or request
labels
Jan 18, 2022
Currently to have fine-grained problem responses we have a lot of functions/methods with the suffix "-WritesProblem" and then returns true if they succeeded or false if they failed and wrote a problem to the gin context.
This would need us to add "NewProblem..." functions to the wharf-core/pkg/ginutil package, and a utility function that wrotes a returned problem response to the HTTP response, or converts a non-problem response to a problem response and then writes that instead to the HTTP response.
This way we could offload a lot of work from the endpoint methods by only using return values. Maybe we could wrap the functions as well so instead of being
func(*gin.Context)
to befunc(*gin.Context) error
where it uses that error->problem.Response that I mentioned in the above paragraph.Just a thought. Could need an RFC to show both the wharf-core changes as well as the changes to the API repos as this would involve a lot of work and the specific implementation needs a good overview.
The text was updated successfully, but these errors were encountered: