Created by: richardwhiuk
This adds anyOf/oneOf support for the Rust Server generator using the support added in https://github.com/Metaswitch/swagger-rs/pull/112
There's a couple of minor core changes to InlineModelResolver - @OpenAPITools/generator-core-team:
-
If we get a model named
12345AnyOfObject
, rename it to_12345AnyOfObject
, not_2345AnyOfObject
.This means for Rust Server, it'll end up as Model12345AnyOfObject, instead of Model2345AnyOfObject, which is nonsensical.
⚠ ️ I think this is technically breaking, but it's clearly bugged at the moment. -
Perform inline model resolution for enums, and pass the type through when performing inline model resolution.
There's a couple of minor fixups in Rust Server:
-
Some minor template tweaking, including putting the IntoHeader implementation below the model definition.
-
Update the supported features - we've support XML Structure Definition for a while - but the global feature flag is wrong - see user feedback in https://github.com/OpenAPITools/openapi-generator/issues/5594.
-
Handle FromStr properly, which breaks for the oneOf model otherwise.
Optimistically, I'd like to merge this before 5.0 gets cut.
This change is by @mirw and myself on behalf of @Metaswitch.
Rust Server Technical Committee
- @frol
- @farcaller
- @paladinzh
PR checklist
-
Read the contribution guidelines. -
If contributing template-only or documentation-only changes which will change sample output, build the project beforehand. -
Run the shell script ./bin/generate-samples.sh
to update all Petstore samples related to your fix. 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/config/java*
. For Windows users, please run the script in Git BASH. -
File the PR against the correct branch: master
-
Copy the technical committee to review the pull request if your PR is targeting a particular programming language.