OpenAPITools / OpenAPITools/openapi-generator
[REQ] [RUST] Allow to choose different `Vec`, `String` and `HashMap` types
Nobody has claimed this yet.
- 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:
smallvecinstead ofVec- either
smartstringorsmolstrinstead ofString heapless::FnvIndexMapor similar instead ofHashMap
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
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
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