Closed damooo closed 1 year ago
Hi!
I will add the request extensions from the http
crate to the ApiError to fulfill this use case.
For the HttpApiProbem
itself i will expose the fields mutably
There is a draft PR (WIP): https://github.com/chridou/http-api-problem/pull/41
Hello @chridou, though http::extensions
allows for extensibility, it doesn't fit well in use case of extensible errors, where we normally require record-like extensions. I.e. kv pairs with multiple keys having same value type.
Instead i suggest to use typemap_rev
for allowing such use case with typed keys. This will then be breeze to practical extensible errors.
Now new version is available on crates.io. Thanks for great work @chridou
Currently any custom values added to a problem will be serialized into response. This may be problem, if we want to use them as error extensions in middleware, and ignore in final response. It would be helpful, if there is a convention for private values, or a method to delete them directly.