10 Commits

Author SHA1 Message Date
Benoît Courtine
fa72c63b62
[Rust][Client] Unify sync/async client structure (#6753)
* Unify sync/async client structure (configuration as first param instead of a struct).

* Fix: Hyper client requires the client.rs file.

Co-authored-by: Henning Holm <git@henningholm.de>

* Add API method comments (description and/or notes when available).

Co-authored-by: Henning Holm <git@henningholm.de>
2020-07-01 15:24:20 +08:00
Benoît Courtine
93bd8571d3
[Rust][Client] Multiple returns becomes optional (fixes #6650). (#6673)
* fixes #6650. Rust client: multiple returns becomes optional.

* Rename new param "supportMultipleReturns" into "supportMultipleResponses".

* Remove redundant `UnknownList` enum option.

* update doc

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-06-19 14:57:01 +08:00
Benoît Courtine
8e2bf99ffb
[Rust][Client][Reqwest] Better http error handling (#6481)
* Stronger typing for http errors with Rust client. (#5609).

* Error structure can be parametrized (but is still hardcoded with `serde_json::Value` in generated code).

* Each API method has is own enum of functionnal errors.

* Fix the missing "Debug" derivation for API error enums.

* Generate models for error deserialization.

* Handle several 2xx success models.

* Expose new API objects, required to use the API (params, success, error structs/enums).

Co-authored-by: William Cheng <wing328hk@gmail.com>
2020-06-13 12:28:53 +08:00
William Cheng
bde0d77c8f
[Rust][reqwest] add async support (#6464)
* fix rust sync client

* update doc
2020-05-29 00:45:51 +08:00
William Cheng
e3faeac0f5
fix struct export in rust reqwest (#6453) 2020-05-28 09:30:00 +08:00
William Cheng
d22bea216c
Add "useSingleRequestParameter" option to Rust client generator (#6230)
* add useSingleParameter option

* fix group parameter in rust reqwest

* rust-single-param
2020-05-11 15:27:59 +08:00
Emanuel Borsboom
6e2e542f83 [Rust] Derive more traits (#4142)
* Simple enums: add: Clone, Copy, Eq, Ord, PartialOrd, Hash
* Structs and complex enums: add `Clone`
2019-11-19 16:15:23 +08:00
Benoît Courtine
dd08ea7a6b [Rust] [Fix #3052] Handle optional and nullable parameters (#4016)
This PR includes theses changes:

- Handling "optional" parameters is not optional anymore. Handling an additional parameter for it makes templates more complicated, and IMO, it is not worth it (as discussed in issue, it is an "acceptable" breaking change).
- Optional parameters are handled everywhere: path params, query params, form params... Generated sample code compiles (both hyper and reqwest libraries).
2019-10-15 13:59:37 +01:00
Gabriel Féron
f96ed69c26 Add rust discriminator (#3895)
* Add support for the `discriminator` feature of OpenAPI 3, and implement it with `enum` in Rust
* Add all missing explicit `dyn` to trait types to remove warnings
* Add missing re-export for properties that are enum (was missing from #2244).
2019-10-06 17:35:14 +01:00
Benjamin Gill
eb793ae279
[rust] Make it easier to test rust client generator (#3543)
As we discovered in #3463, there are various bits of the rust client generator that are currently untested. This PR adds tests for various generator-specific types, and also files.

Follows the example of the rust-server generator for making it easy to add new test specs. This should make it easier for future contributors to make sure that their contributions are tested
2019-09-27 16:27:28 +01:00