OpenAPITools / OpenAPITools/openapi-generator

[REQ] [RUST] Allow to choose different `Vec`, `String` and `HashMap` types

Open
#10,102 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.

Unnecessary allocations.

Describe the solution you'd like

I'd like to use:

Describe alternatives you've considered

I tried using something like --import-mappings=Vec=smallvec::SmallVec --type-mappings=Vec=smallvec::SmallVec but it didn't work.

I also considered having a const array as input, but this wouldn't work for deserialization and would need to be wrapped into an enum with a variant for heap and a variant for the stack which would just do the same thing as smallvec, tinyvec etc.

Additional context

I haven't thought through how compatibility with serde would work.

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

No files or tests are named. Start by examining the Rust generator's handling of Vec, String, and HashMap mappings, then investigate compatibility with serde and the requested smallvec, smartstring, smolstr, or heapless types. Done means users can configure these alternatives and generated code still supports deserialization.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
api
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.