OpenAPITools / OpenAPITools/openapi-generator
[rust-client] Ability to specify path of output
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Currently output is always generated as src/{apis,models} as done by:
In our case we run with a very limited generator (we only want the models).
.openapi-generator-ignore:
**
.openapi-generator/*
!src/models/*.rs
What we end up doing is a little odd:
mkdir -p generated/rust
rm -rf ./src/api/models
docker run --user $(id -u) --rm -v "${PWD}:/local" -w /local/generated/rust openapitools/openapi-generator-cli:v7.12.0 generate -i /local/api/kiburi.v0.yml -g rust --config /local/.openapi-generator/rust/config.yaml
mv ./generated/rust/src/models ./src/api/model
Ideally it would be nicer if we could directly write the models etc to a subfolder inside our rust crate and not require manual modification.
I can imagine an additionalProperty: asModule: true or something like this.
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 with modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java at the referenced lines, then inspect the Rust generator configuration and the docker generate command shown in the issue. Define how an additional property or equivalent configuration should select an output subfolder, and verify that models can be generated directly into the Rust crate without the manual move.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, openapi, rust
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100