Closed trombonehero closed 2 weeks ago
Currently, I have to re-add these traits to my models' #[derive(...)] every time I update them with openapi-generator.
did you try using customized templates (e.g. -t via CLI)?
Hi @wing328, it looks like templates can indeed solve at least part of my issue... thanks!
Is your feature request related to a problem? Please describe.
I have several models that I need to derive traits like
yew::Properties
oryewdux::Store
. Currently, I have to re-add these traits to my models'#[derive(...)]
every time I update them withopenapi-generator
.Describe the solution you'd like
I'd like to pass additional properties like
deriveTraits='Properties,Store'
anduse='yew::prelude::*',use='yewdux::prelude::*'
via the CLI.Describe alternatives you've considered
I've tried creating wrappers around the OpenAPI models, but that leads to awkward duplication and pass-through logic.
I can add non-derived functionality by writing
impl X for ModelName
elsewhere in the crate, but there are some traits that really want to be derived rather than hand-written.Currently I use Git to track which derivations have been deleted by
openapi-generator
and, each time I regenerate from a new version of the API, undo these deletions.Additional context
You can't anticipate every possible use case for these models, so adding extension points seems logical to me.