OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://rust-lang.github.io/api-guidelines/interoperability.html#c-good-err:
An error type is any type E used in a Result<T, E> returned by any public function of your crate. Error types should always implement the std::error::Error trait which is the mechanism by which error handling libraries like error-chain abstract over different types of errors, and which allows the error to be used as the source() of another error. [...]
Describe the solution you'd like
Implementing the corrensponding traits in reqwest\api_mod.mustache would improve error handling when using the generated API.
Describe alternatives you've considered
To solve this for my API client, I implemented the traits myself using a custom template. I would be happy to provide a PR for this, if the change is desired by the community.
Additional context
I am currently using SNAPSHOT version 5.0.0-20200613.071037-272.
To solve this for my API client, I implemented the traits myself using a custom template. I would be happy to provide a PR for this, if the change is desired by the community.
Is your feature request related to a problem? Please describe.
As recommended by the Rust API Guidelines, custom error types used in a
Result<T, E>
should implement thestd::error::Error
andstd::fmt::Display
traits, which is currently not the case.Describe the solution you'd like
Implementing the corrensponding traits in
reqwest\api_mod.mustache
would improve error handling when using the generated API.Describe alternatives you've considered
To solve this for my API client, I implemented the traits myself using a custom template. I would be happy to provide a PR for this, if the change is desired by the community.
Additional context
I am currently using SNAPSHOT version 5.0.0-20200613.071037-272.