OpenAPITools / OpenAPITools/openapi-generator

[REQ] [Rust] Add support for `native-tls` and `rustls-tls` Cargo features for the `reqwest` library

Open
#21,924 0 comments 0 reactions 0 assignees View on GitHub

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:

  1. The Cargo feature to chose between native-tls and rustls-tls is not made available for the reqwest library (only the reqwest-trait library). As a result, a transitive dependency to openssl-sys is pulled. Which is not suitable for some targets.
  2. The feature naming is inconsistent with the rest of the ecosystem: the rustls feature should be called rustls-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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.