-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rust,client): derive Default for operation parameter structs #10432
feat(rust,client): derive Default for operation parameter structs #10432
Conversation
LGTM. I assume this is a backward-compatible change. Please correct me if I'm wrong. |
4c6e0da
to
3b5dfe2
Compare
Looks like this breaks the existing tests:
Ref: https://app.travis-ci.com/github/OpenAPITools/openapi-generator/builds/238201866 Can you please take a look when you've time? |
Ah, that makes sense, yeah: the generated models need to derive |
This makes operations with many parameters easier to work with.
3b5dfe2
to
29bb2b3
Compare
Cool, I updated the model template (and actually tested the generated petstore samples locally, this time 😅). |
29bb2b3
to
d5f003c
Compare
Yes, it is. 👍🏼 |
Seems like it wasn't. This was forgotten for Enums, so a breaking regression for us. We have had to pin Rust SDK to 5.2.0, as 5.3.0 can no longer generate the spec.
|
* Fix breaking regression introduced by #10432 This change forgot enum structures, which causes the compiler to throw errors for "the trait `Default` is not implemented for MyEnum". This change implements the Default trait to the enum template. * fix: add Default for type enums
This makes operations with many parameters easier to work with.
PR checklist
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*
.For Windows users, please run the script in Git BASH.
master
(5.3.0),6.0.x
@frol (2017/07) @farcaller (2017/08) @richardwhiuk (2019/07) @paladinzh (2020/05)