OpenAPITools / OpenAPITools/openapi-generator
[REQ] [Rust] Add support for `native-tls` and `rustls-tls` Cargo features for the `reqwest` library
Open
Nobody has claimed this yet.
Enhancement: Feature
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Is your feature request related to a problem? Please describe.
The Rust client SDK generator has 3 Cargo feature related problems:
- The Cargo feature to chose between
native-tlsandrustls-tlsis not made available for thereqwestlibrary (only thereqwest-traitlibrary). As a result, a transitive dependency toopenssl-sysis pulled. Which is not suitable for some targets. - The feature naming is inconsistent with the rest of the ecosystem: the
rustlsfeature should be calledrustls-tls.
Describe the solution you'd like
reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] }
[features]
default = ["native-tls"]
native-tls = ["reqwest/native-tls"]
rustls = ["reqwest/rustls-tls"]
Describe alternatives you've considered
Overriding Cargo.mustache works. But I'm sure I'm not the only one with this problem.
Additional context
I will open a PR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the Rust client SDK generator and inspect Cargo.mustache, especially the reqwest and reqwest-trait feature definitions. Generate a Rust client and compare the resulting Cargo.toml with the requested feature mappings. Done means native-tls and rustls-tls can be selected for reqwest without an unwanted openssl-sys dependency.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100