forked from loafle/openapi-generator-original
feat(rust): support ability to disable boxed models in client (#17931)
* feat(client): support ability to disable boxed models Add new additional property `avoidBoxedModels` which can be configured to avoid `Box<..>` of models. It's very nice to have such config, because it doesn't make a lot of sense for really simple models. * test: rollback config of existed test
This commit is contained in:
@@ -21,7 +21,7 @@ pub enum CreateStateRequest {
|
||||
|
||||
impl Default for CreateStateRequest {
|
||||
fn default() -> Self {
|
||||
Self::AType(Box::default())
|
||||
Self::AType(Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ pub enum CustomOneOfArraySchemaInner {
|
||||
|
||||
impl Default for CustomOneOfArraySchemaInner {
|
||||
fn default() -> Self {
|
||||
Self::AType(Box::default())
|
||||
Self::AType(Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ pub enum CustomOneOfSchema {
|
||||
|
||||
impl Default for CustomOneOfSchema {
|
||||
fn default() -> Self {
|
||||
Self::AType(Box::default())
|
||||
Self::AType(Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ pub enum GetState200Response {
|
||||
|
||||
impl Default for GetState200Response {
|
||||
fn default() -> Self {
|
||||
Self::AType(Box::default())
|
||||
Self::AType(Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,13 +13,13 @@ use crate::models;
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(untagged)]
|
||||
pub enum Fruit {
|
||||
Apples(Box<std::collections::HashMap<String, models::Apple>>),
|
||||
Grapes(Box<Vec<models::Grape>>),
|
||||
Apples(std::collections::HashMap<String, models::Apple>),
|
||||
Grapes(Vec<models::Grape>),
|
||||
}
|
||||
|
||||
impl Default for Fruit {
|
||||
fn default() -> Self {
|
||||
Self::Apples(Box::default())
|
||||
Self::Apples(Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ pub enum Fruit {
|
||||
|
||||
impl Default for Fruit {
|
||||
fn default() -> Self {
|
||||
Self::GreenApple(Box::default())
|
||||
Self::GreenApple(Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ pub enum BarRefOrValue {
|
||||
|
||||
impl Default for BarRefOrValue {
|
||||
fn default() -> Self {
|
||||
Self::Bar(Box::default())
|
||||
Self::Bar(Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ pub enum FooRefOrValue {
|
||||
|
||||
impl Default for FooRefOrValue {
|
||||
fn default() -> Self {
|
||||
Self::Foo(Box::default())
|
||||
Self::Foo(Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ pub enum Fruit {
|
||||
|
||||
impl Default for Fruit {
|
||||
fn default() -> Self {
|
||||
Self::Apple(Box::default())
|
||||
Self::Apple(Default::default())
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user