Open mistermoe opened 1 month ago
another thought that crossed my mind is that these error messages returned by FTL won't match a developer-defined error response type.
e.g. a developer is designing an API and has decided that all non 2xx responses will have a response body that looks something like:
type APIError struct {
Message string
Errors []Error
}
//ftl:data export
type Error struct {
Message string
Code ftl.Option[int]
Field ftl.Option[string]
}
Given the following verb:
sending a request without the required query param results in the following response:
it's awesome that FTL handles validation but i think the response can be improved. Most of the current response is unhelpful and potentially misleading to a caller. If i hadn't implemented this verb and received
lnurl.GetPayReqRequest.query.lnurl
as a response. i would think:lnurl.GetPayReqRequest
?maybe something along the lines of "lnurl is a required query param"