Skip to content

[rust-client] Ability to specify path of output #20963

@lahabana

Description

@lahabana

Currently output is always generated as src/{apis,models} as done by:

protected String apiFolder = "src/apis";
protected String modelFolder = "src/models";

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions