* [Rust] Update reqwest dependency to 0.13 with query and form features
Update the Rust client generator template to use reqwest 0.13 instead
of 0.12, as requested in issue #22621.
In reqwest 0.13, the `query()` and `form()` methods have been moved
behind feature flags and are disabled by default. Since the generated
Rust clients extensively use both methods, these features must be
explicitly enabled.
Changes:
- Updated all reqwest dependencies from ^0.12 to ^0.13
- Added "query" and "form" to reqwest feature flags for all variants:
- Blocking client configuration
- Async client with file stream support
- Async client without file stream
- Reqwest-trait variant
- Updated reqwest-middleware features for consistency
This maintains full backward compatibility as only the dependency
version and features change. The API surface of generated code
remains identical.
Fixes#22621
* [Rust] Updated samples
* [Rust] Rename rustls-tls feature to rustls to match reqwest 0.13
In reqwest 0.13, the rustls-tls feature was renamed to rustls.
This updates the Cargo.mustache template and all generated samples
to use the new feature name, fixing CI build failures when using
--all-features flag.
* [Rust] Upgrade reqwest-middleware to 0.5 for reqwest 0.13 compatibility
The previous reqwest-middleware 0.4 depends on reqwest 0.12, which caused
type conflicts when upgrading to reqwest 0.13:
- reqwest::Error (from reqwest 0.13)
- reqwest_middleware::reqwest::Error (from reqwest 0.12 via middleware)
These are different types from different versions of reqwest.
reqwest-middleware 0.5 is compatible with reqwest 0.13, resolving the
version conflict. With both using the same reqwest version, the re-exported
types are now correctly aligned.
* [Rust] Use query and form features from reqwest-middleware
It adds "query" and "form" features for reqwest-middleware crate in petstore-async-middleware example and Cargo.mustache template.
---------
Co-authored-by: Emil Bonne Kristiansen <emilbonnek@gmail.com>
* [Rust] Enum Query Parameter Serialization Fixes
Adds tests to ensure this won't regress again. Also fixes some other compile errors with Box<> and file uploads.
* Remove duplicate query param integration tests from petstore samples
* re-gen samples
* fix enum boxing tests
* stream files
* samples
* doc generator fix & snapshot
* doc generation fixes, update samples
* another attempt to fix the doc generator
* improve doc generation - don't try link to internal models, and fixing links missing in some scenarios
the rust doc generator will be the death of me
* also fix hyper
* applying same fix to hyper
* snapshot fixes
* Add CLI option
* Add dep to generated Cargo.toml
* Add new `Error::SerdePathToError` error type
* Add `serde_path_to_error` invocation to API layer
* Add sample for serde-path-to-error
* Add arg & docstring to cliOptions as well
* Fix sample
Previously, if an API endpoint was marked deprecated, this fact was not
reflected in the generated Rust clients using the reqwest library. We
want to know exactly when our client code is using a deprecated endpoint,
so marking the corresponding functions with the `#[deprecatd]` attribute
would be very helpful. Uses of the endpoint would then be picked up by
linters so that we can react.
This adds a line to the template which marks functions generated from
deprecated endpoints with the `#[deprecated]` attribute.
This does not touch any of the other client generators for Rust or any
other language, since they are out of scope for our needs.
Co-authored-by: Bradford Hovinen <bho@qwello.eu>
* feat(rust): add the native-tls (default) and rustls Cargo features for `reqwest`
* refactor(rust): rename the `rustls` Cargo feature to follow the ecosystem naming convention
* [Rust] fix: add location prefix to prevent parameter name collisions when escaping parameter names
* chore: update samples
* [Rust] fix: do not use locationSuffix if useSingleRequestParameter feature is enabled
* [rust] support model/maps as deep/explode params
* [rust] add tests for rust deep objects
* [rust] detect normal non deep objects
* [rust] distinguish model and object
* [rust] fix objects as params for hyper
* Fix for allof multi model with only metadata fields
* Update samples
* fixed compiler errors in java 17 and lower
* refactored isMetadataOnlySchema to ModelUtils.java
* fix(rust): Fixed Rust model files not matching module imports causing compiler errors
* chore(rust): Update samples with a duplicate model test
* update samples
---------
Co-authored-by: Ross Sullivan <rosssullivan101@gmail.com>
* [rust] Added support for text/plain to reqwest-trait client
* Updated samples
* [rust] Added support for text/plain to reqwest client
* Updated samples
* cleanup
* reduced compiler warnings
* fixed text/plain content with charset
* Only deserialize text/plain if the API produces it
* prevent all name clashes by using a prefix for all parameters, this way they CANNOT clash with anything locally, as our hardcoded stuff in mustache files doesnt start with "p_" ,
when using the grouped option, we just use the params directly and dont unpack the variables at all, prevending furthur name clashes.
* get rid of "local_var" prefix, now that we no longer clash with paramater names
* fix a typo and remove the r# generated to the paramName when we create the identifier
* java code formatting and added a fake-endpoint parameter test
* update rust samples
* [rust][reqwest] support binary type for upload and download
* [rust][reqwest] support binary download in supportMultipleResponses contexts
* [rust][reqwest] support binary responses that don't have any return type
* Added Rust Reqwest trait based client
* Fixed Cargo imports for reqwest trait template
* Added support for mockall to Rust reqwest trait library
* Added MockApiClient when mockall and topLevelClient are enabled
* Added missing flags to Rust generator documentation
* feat: add support for single argument and bon builder
Adds support for single argument and bon building for the new
reqwest-trait generator
* Rebuilt rust samples
---------
Co-authored-by: Troy Benson <troybensonsa@gmail.com>