Open mlms13 opened 1 year ago
In looking at that example, I think it's important that we use the "error"
field consistently so that it can be a discriminator to reconstruct the original error data. Specifically, looking at "order_ids"
in that example, there's not enough information to expect the value to be an array.
One common use case for
bs-decode
is a webserver that decodes the payload of a request. In this case, it would be desirable to send back a400
response with a response that includes structured errors that are related to the structure of the request.Something like:
Not sure what the exact structure should be, but it should be something predictable and easy to describe, so that your webserver can document the errors it will return and clients can theoretically do something useful with that data structure.
We already have examples of converting the structured
ParseError
type to a string in a way that preserves some of the nesting structure, so I think this should be pretty doable.