feat(rust-client): Export Client for easier use
Merged
SI
2mo ago+24+24+01234567890123456789-0-0-0123456789
This makes it easier to create clients in projects that use the generated project. It also prevents version conflicts. For example, it is possible to simply create the client with the exported petstore::apis::configuration::Client.
@frol (2017/07) @farcaller (2017/08) @richardwhiuk (2019/07) @paladinzh (2020/05) @jacob-pro (2022/10) @dsteeley (2025/07)
PR checklist
- Read the contribution guidelines.
- Run the following to build the project and update samples:
(For Windows users, please run the script in WSL)./mvnw clean package || exit ./bin/generate-samples.sh ./bin/configs/*.yaml || exit ./bin/utils/export_docs_generators.sh || exit
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/configs/java*.
IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed. - If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.
Summary by cubic
Exports the HTTP client type from generated Rust clients' configuration module. Previously, downstream projects had to depend on reqwest directly to instantiate a client; now they can use the re-exported apis::configuration::Client (or ClientWithMiddleware when middleware is enabled) to avoid version conflicts.