[Rust] Add support for discriminator#3895
Conversation
Co-authored-by: Adi Ritman <55248441+ritmanadi@users.noreply.github.com>
|
Errors reported by the Travis CI: ref: https://travis-ci.org/OpenAPITools/openapi-generator/builds/585652775 |
We can't re-export those types because their name is derived from the property name, which might be duplicated.
e3a81e4 to
3c1d778
Compare
good catch, sorry for that. I've adapted my changes. |
|
Pinging @bjgill and @richardwhiuk for a review |
|
Thanks. I'm quite busy this week, so will take a look next week unless this is urgent. |
...es/openapi-generator/src/main/java/org/openapitools/codegen/languages/RustClientCodegen.java
Show resolved
Hide resolved
|
I've just merged the conflicting PR. You should just need to rebase onto master and re-generate the samples again. |
Done, I added a small change to the template files to remove some |
|
Thanks. I'll merge this, which should fix #4079 |
This patch includes: - Add all missing explicit dyn to trait types to remove warnings OpenAPITools/openapi-generator#3895 - Add missing re-export for properties that are enum OpenAPITools/openapi-generator#3895 - Handle optional parameters OpenAPITools/openapi-generator#4016 - Derive more traits borsboom/openapi-generator@4e3bc31
Built using borsboom/openapi-generator@4e3bc31 This patch includes: - Add all missing explicit dyn to trait types to remove warnings OpenAPITools/openapi-generator#3895 - Add missing re-export for properties that are enum OpenAPITools/openapi-generator#3895 - Handle optional parameters OpenAPITools/openapi-generator#4016 - Derive more traits borsboom/openapi-generator@4e3bc31
|
@gferon thanks for the PR, which has been included in v4.2.0 release: https://twitter.com/oas_generator/status/1189824932345069569 |
PR checklist
./bin/to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh,./bin/openapi3/{LANG}-petstore.shif updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\. If contributing template-only or documentation-only changes which will change sample output, be sure to build the project first.master,4.1.x,5.0.x. Default:master.Description of the PR
discriminatorfeature of OpenAPI 3, and implement it withenumin Rustdynto trait types to remove warningsrustand skip none option serialization in clients #2244).Example
A schema that looks like:
would generate a Rust enum like: