OpenAPITools / OpenAPITools/openapi-generator

Feedback on Rust client generator

Open
#22,080 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Rust General: Suggestion
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Feedback from @dctaf on the Rust client generator:

  • Rust: The feature set matrix for the Rust clients is misleading:
    It does support bearer-style "Authorizations" but the table suggests otherwise.
    There are "X" marks in allOf and anyOf but this is incorrect or at least misleading.

  • Rust: When supportMultipleResponses=true, the generated Success and Failure types are awkward to use. Generating code similar to this would make API use much more ergonomic:

 impl CreateExperimentSuccess {
   fn into_status200(self) -> Result<CreateExperimentResponse> {
     match self {
       Self::Status200(resp) => Ok(resp),
       Self::UnknownValue(_) => anyhow::bail!("unexpected response variant"),
     }
   }
}
  • Rust: The documentation would benefit from examples of how the calling interfaces differ when library={hyper,reqwest,reqwest-trait}.

If anyone wants to work on these improvements, please reply to let us know.

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 with the Rust client generator areas responsible for the feature set matrix, multiple-response types, and library-specific documentation. Compare the matrix with the stated bearer, allOf, and anyOf support, review the supportMultipleResponses output and the hyper, reqwest, and reqwest-trait interfaces. Done means the reported inaccuracies are corrected, response use is more ergonomic, and the documentation includes the requested examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api, documentation, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.